The following should work:
Code:
<head>
<script type="text/javascript">
function HttpRequest(url){
var pageRequest = false //variable to hold ajax object
/*@cc_on
@if (@_jscript_version >= 5)
try {
pageRequest = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try {
pageRequest = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e2){
pageRequest = false
}
}
@end
@*/ if (!pageRequest && typeof XMLHttpRequest != 'undefined')
pageRequest = new XMLHttpRequest()
if (pageRequest){ //if pageRequest is not false
pageRequest.open('GET', url, false) //get page synchronously
pageRequest.send(null)
document.write(pageRequest.responseText)
}
}
function display(which,width,height)
{
document.getElementById(which).style.visibility='visible';
document.getElementById(which).style.marginTop='15px';
document.getElementById(which).style.padding='5px';
document.getElementById(which).style.width=width;
document.getElementById(which).style.height=height;
}
function erase(tag,className) {
var els = document.getElementsByTagName(tag)
for (i=0;i<els.length; i++) {
if (els.item(i).className == className){
els.item(i).style.visibility="hidden";
}
}
}
</script>
</head>
<body>
<button style="cursor: pointer" onclick="erase('div','inserted')">HIDE</button><br>
<a href="javascript:void(0)" onclick="erase('div','inserted');display('rightcolumn1','540px','585px');">Porsche</a> <br>
<a href="javascript:void(0)" onclick="erase('div','inserted');display('rightcolumn2','540px','545px');">Ferrari</a><br>
<a href="javascript:void(0)" onclick="erase('div','inserted');display('rightcolumn3','540px','450px');">Aston</a>
<div id="rightcolumn1" class="inserted" style="visibility:hidden; position:absolute; height:0px; top:20px; left:30%; border: 1px solid black"><script type="text/javascript">HttpRequest("ajaxfiles/external.htm") </script></div>
<div id="rightcolumn2" class="inserted" style="visibility:hidden; position:absolute; height:0px; top:20px; left:30%; border: 1px solid black"><script type="text/javascript">HttpRequest("ajaxfiles/external2.htm") </script></div>
<div id="rightcolumn3" class="inserted" style="visibility:hidden; position:absolute; height:0px; top:20px; left:30%; border: 1px solid black"><script type="text/javascript">HttpRequest("ajaxfiles/external3.htm") </script></div>
</body>
You don't need the loadobjs function if you do it like this. All the external css and js will function properly. Experiment with it.
===
Arie.
Bookmarks