Forum Moderators: open
PROBLEM:
I use about 7 different Javascript functions on my website and ALL work fine in Firefox, but there are 3 that will not work in Internet Explorer since yesterday!
I have been using all 7 functions for the last month or so and have had no problems in either browser up until yesterday.
The only thing i did was play with organization of my scripts, i had a lot of code on the < head > part of my pages so i wanted to put all that into a linked JS file. So i did and it worked fine in Firefox, but notIE. so i put the code back into the < head > and only 3 functions work in IE but ALL work in Firefox.
The 7 functions i use are: (all work fine in Firefox)
- Slashdot Menu (DHTML collapsable menu)
- Image carousel (image loop with links and stop function)
- Show/Hide (using tables not DIV)
- TR Rollover highlight (highlight rows with color on rollover)
- Jump Menu
- Swap image rollover
- Open Browser window
Only these work in Internet Explorer:
- Jump menu, Swap image, and Open browser window
The code i used for the JS link is :
<script type="text/javascript" src="slashfiles/menu.js"></script>
<script type="text/javascript" src="scripts/scripts.js"></script>
...................................................................
My Header looks like this:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta>
<title></title>
<meta>..............
<link (style sheets)>
<script type="text/javascript">
(My swap image, jump menu, open browser window functions)
</script>
<script>
(My TR rollover highlight functions)
</script>
<script type="text/javascript" src="slashfiles/menu.js"></script>
<script type="text/javascript" src="scripts/scripts.js"></script>
<body OnLoad="init(); fillup();">
......................................................................
So i hope that is enough info to work with.
I really appreciate any kind of help i can get.
...............................................................
var highlightbehavior="TR"
var ns6=document.getElementById&&!document.all
var ie=document.all
function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TABLE")
return
while(source.tagName!=highlightbehavior && source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}
function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}
function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)¦¦source.contains(event.toElement)¦¦source.id=="ignore")¦¦source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)¦¦source.id=="ignore"))
return
if (ie&&event.toElement!=source¦¦ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}
..............................................................
That shows the "IF" of that function, but i still dont know what you mean about DOM?
There must be a syntax error somewhere. Is your code only reorganized, or parts have also been deleted?
Line 86 contains:(i included a couple lines before it)
function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)¦¦source.contains(event.toElement)¦¦source.id=="ignore")¦¦source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)¦¦source.id=="ignore"))
return
if (ie&&event.toElement!=source¦¦ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
};
</script> <<<<<<<<<<<Line 86 <<<<<<<<<<<<<<<<
Line 95 contains:(i included a couple lines before it)
<!--START GOOGLE TRACKING-->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1353703-1";
urchinTracker(); <<<<<<<<<<<<Line 95<<<<<<<<<<<<
</script>
<!--END GOOGLE TRACKING-->
I went back to the original javascript source and pasted that over my code again to see if i accidentaly deleted somethign and still no change. I will still keep hacking at it!
On the ipods page, in the second javascript block (the first being the one with swapimage code), you're opening an html comment but not closing it.
Either close it, or remove the opening tag.
<script type="text/javascript">
<!--
/***********************************************
* Highlight Table Cells[...]
//-->
</script>
This will solve the problem with the menu.
In the body tag onload attribute you're referencing fillup(). I don't see this function anywhere.