Sorry fo the delay...
I can't put it in the onload as Body Onload is already is locked to a template with another onload function.
Main Topics
Browse All TopicsI am having an issue with the following Javascript in Internet Explorer 6.
it displays an error in the IE6 toolbar, saying invalid.
it works fine in IE7,8 and Firefox. I NEED it to work in IE6, it's a requirement.
I didn't realize it didnt work until someone called me.. oops!
The script create an onload function and then attempts to retrive data from the primary source and if it fails it goes to a secondary. I can't use a Body onLoad as it's already locked into a temple. Thsi code orks flawlessly on other versions of IE.
Can someone take a look and see if there is something I can do to this script to make it play nice with IE6?
Code:
<script type="text/javascript">
window.onload = function()
{
LoadPrimaryDataSourceURL("
};
function LoadPrimaryDataSourceURL(d
try {
var xreq = XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.X
}
catch (e) {}
xreq.onreadystatechange = function() {
if (xreq.readyState == 4) {
if (xreq.status == 200) {
document.getElementById("o
}
else {
LoadBackupDataSourceURL("s
}
}
}
xreq.open("GET", dest, true);
xreq.send(null);
}
function LoadBackupDataSourceURL(de
try {
var xreq = XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.X
}
catch (e) {}
xreq.onreadystatechange = function() {
if ((xreq.readyState == 4) && (xreq.status == 200)) {
document.getElementById("o
}
}
xreq.open("GET", dest, true);
xreq.send(null);
}
</script>
<div id="loading" style="position:top; width:100%; text-align:center; color : 666699; font-size:14px; font-family : Verdana, Arial, Helvetica, sans-serif; top:300px;";>
<br>Please wait while your request is being processed.<br><br>
<img src="loadingajax.gif" border=0></div>
<script>
var ld=(document.all);
var ns4=document.layers;
var ns6=document.getElementByI
var ie4=document.all;
if (ns4)
ld=document.loading;
else if (ns6)
ld=document.getElementById
else if (ie4)
ld=document.all.loading.st
function init()
{
if(ns4){ld.visibility="hid
else if (ns6||ie4) ld.display="none";
}
</script>
<div id="output"></div>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: BadotzPosted on 2009-11-09 at 02:24:33ID: 25774672
>>it displays an error in the IE6 toolbar, saying invalid.
Invalid what?
>>I can't use a Body onLoad as it's already locked into a temple. (sic)
Move the JavaScript out of the DIV and into the window.onload function. You cannot reliably manipulate the DOM until the page has rendered.