wrote on 18 mrt 2006 in comp.lang.javascript
:
got the following problem: I need to include an HTML file that sits on
another server B in an HTML file that sits on server A, and I need to
include this at a particular place in the file. The "include" command
doesnt work obviously as it is server-side.
That would only be obvious if you preclude that serverside coding.
In other words: say I have a webpage, at a particular place, for
example halfway down, I want to include HTML that sits on another
server.
Can anyone point to a javascript code that can do this?
Use in IE:
function getUrl(url) {
var http = new ActiveXObject("microsoft.xmlhttp");
http.open("GET",url,false);
http.send();
return http.responseText;
}
Look here:
<http://xkr.us/code/javascript/XHConn/>
for a more cross browser solution.
Many security settings will give you a nightmare, so:
The best solution is swapping your server to an ASP (or PHP) one!
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)