Can anyone figure out why this is throwing a syntax error? All of the code looks correct to me.
<script type="text/javascript">
var rootdomain="http://"+window.location.hostname;
function ajaxinclude(url)
{
var pagerequest = false;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
pagerequest = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
pagerequest = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
pagerequest = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
pagerequest.open('GET', url, false) //get page synchronously
pagerequest.send(null)
writecontent(pagerequest)
}
function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || pagerequest.status==200)
document.getElementById("page1").innerHTML = pagerequest.responseText;
}
It's throwing an error on line 7 -- var pagerequest = false;
If you comment it out, it just throws an error on the next line. Any ideas?
Thanks in advance for your help!!