/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function import(url) { var req = new XMLHttpRequest(); var isSuccessful = function() { try { return ( req.status >= 200 && req.status < 300 ) || req.status == 304 || navigator.userAgent.indexOf("Safari") >= 0 && typeof req.status == "undefined"; } catch(e){} return false; } req.open('GET', url, true); req.onreadystatechange=function() { if ( req.readyState == 4) { if(isSuccessful()) { eval.call( window, req.responseText ); } } } req.send(); };