Forum Moderators: open
<script>
var http;
function getPage(url)
{
if ((navigator.appName.indexOf("Microsoft")>-1) ¦¦ (navigator.appName.indexOf("MSIE")>-1))
{
http = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
http = new XMLHttpRequest();
}
if (http)
{
http.open("get", "sources/mainNav/" + url + ".php");
http.onreadystatechange = handleResponse;
http.send(null);
}
}
function handleResponse()
{
if (http.readyState == 4)
{
var content = http.responseText;
if (content && content!= "")
document.getElementById("innerContent").innerHTML = content;
}
}
</script>
Then to call it:
<a href="#" onclick="getPage('allproducts');">All Products</a> And it should change:
<p id="innerContent"></p> This works perfectly fine in Firefox 2, but I have tested this script on 3 machines with IE7, and 2 with IE6, and it doesn't change the paragraph inner content.
So just wondering if you know the problem.
Thanks
Andy
<script type="text/javascript">
var http= false;
function getPage(url)
{
if(window.XMLHttpRequest)
{
// Mozilla, Safari, ...
http = new XMLHttpRequest();
if(http.overrideMimeType)
{
http.overrideMimeType('text/xml');
}
}
else if(window.ActiveXObject)
{
// IE
try
{
http = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
http = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {}
}
}
if (http)
{
http.open("get", "sources/mainNav/" + url + ".php");
http.onreadystatechange = handleResponse;
http.send(null);
}
}
function handleResponse()
{
if (http.readyState == 4)
{
var content = http.responseText;
if (content && content!= "")
document.getElementById("innerContent").innerHTML = content;
}
}
</script>
JQuery and ThickBox, and that IE doesnt support extra javascript/ajax within the box.
But FireFox does, what I shall do is contact the creator of ThickBox to see if he knows of this, and a possible fix to my problem.
Thanks anyway
Andy