Lid |
|
Ik heb een bestand dat ik via een externe site wil ophalen. Op de ene site lukt het wel, maar op de andere niet. Weet iemand waar het aan kan liggen?
document.include = function (url) {
if ('undefined' == typeof(url)) return false;
var p,rnd;
if (document.all){
// For IE, create an ActiveX Object instance
p = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
// For mozilla, create an instance of XMLHttpRequest.
p = new XMLHttpRequest();
}
// Prevent browsers from caching the included page
// by appending a random number (optional)
rnd = Math.random().toString().substring(2);
url = url.indexOf('?')>-1 ? url+'&rnd='+rnd : url+'?rnd='+rnd;
// Open the url and write out the response
p.open("GET",url,false);
p.send(null);
document.write( p.responseText );
}
document.include = function (url) { if ('undefined' == typeof(url)) return false; var p,rnd; if (document.all){ // For IE, create an ActiveX Object instance p = new ActiveXObject("Microsoft.XMLHTTP"); } else { // For mozilla, create an instance of XMLHttpRequest. p = new XMLHttpRequest(); } // Prevent browsers from caching the included page // by appending a random number (optional) rnd = Math.random().toString().substring(2); url = url.indexOf('?')>-1 ? url+'&rnd='+rnd : url+'?rnd='+rnd; // Open the url and write out the response p.open("GET",url,false); p.send(null); document.write( p.responseText ); }
<script type="text/javascript">
document.include('//rickvanhout.nl/x/copyright.html');
</script>
<script type="text/javascript"> document.include('//rickvanhout.nl/x/copyright.html'); </script>
|