This one is driving me insane. The script works perfect on Firefox,
but Internet Explorer keeps complaining about "Error Object Expected"
and stuff like that. I've run it through Firefox's Java Console, and
it comes back with no errors. Any pointers on this, would be much
appreciated.
<script type="text/javascript">
<!--
var p = new Array(0,0,0,0,0 )
var c = new Array(0,0,0,0,0 ,0,0,0,0)
var classes = new Array(5)
classes[0] = "<a href='javascrip t:class(0)'>ASM 2O<\/a><div
id='c0'><\/div><a href='javascrip t:class(1)'>PPL 2O<\/a><div
id='c1'><\/div>"
classes[1] = "<a href='javascrip t:class(2)'>SNC 2D<\/a><div
id='c2'><\/div><a href='javascrip t:class(3)'>CHC 2D<\/a><div
id='c3'><\/div>"
classes[2] = "<a href='javascrip t:class(4)'>ENG 2D<\/a><div
id='c4'><\/div><a href='javascrip t:class(5)'>MPM 2D<\/a><div
id='c5'><\/div>"
classes[3] = "<a href='javascrip t:class(6)'>bre ak<\/a><div
id='c6'><\/div>"
classes[4] = "<a href='javascrip t:class(7)'>GLC 2O<\/a><div
id='c7'><\/div><a href='javascrip t:class(8)'>BBI 2O<\/a><div
id='c8'><\/div>"
var hom = new Array(8)
hom[0] = "<ul><li>Mo tion tweening<\/li><li>Shape
tweening<\/li><li>Splice<\/li><li>Motion guides<\/li><\/ul>"
hom[1] = "<ul><li>Stuff< \/li><\/ul>"
hom[2] = "<ul><li>Megatr ansect II<\/li><li>Workshee t<\/li><li>10.3
#1-14<\/li><\/ul>"
hom[3] = "<ul><li>Stuff< \/li><\/ul>"
hom[4] = "<ul><li>Re ad 2.1<\/li><li>Redo journal<\/li><\/ul>"
hom[5] = "<ul><li>Stuff< \/li><\/ul>"
hom[6] = "<ul><li>Yo u think you can get homework from a lunch
period?<\/li><\/ul>"
hom[7] = "<ul><li>Techno logy careers presentation<\/li><\/ul>"
hom[8] = "<ul><li>Stuff< \/li><\/ul>"
function display(period) {
if(p[period]==0){
document.getEle mentById("p"+pe riod).innerHTML =classes[period]
p[period]=1
}
else{
document.getEle mentById("p"+pe riod).innerHTML =""
p[period]=0
}
}
function class(num){
if(c[num]==0){
document.getEle mentById("c"+nu m).innerHTML=ho m[num]
c[num]=1
}
else{
document.getEle mentById("c"+nu m).innerHTML=""
c[num]=0
}
}
//-->
</script>
----------------------------------------------------------------------------
You can see the script in context here:
The gist of it, is that a link is clicked which calls display(period) .
This will then display the appropriate element from classes[] which in
turn provides a link that calls class(num) and displays the
corresponding element from hom[]
Again, works nice on Firefox.
Internet Explorer:
Upon loading, it gives this error:
Line: 42
Char: 10
Error: Expected '('
Code: 0
And when clicking one of the links it gives this error
Line: 1
Char: 1
Error: Object Expected
Code: 0
but Internet Explorer keeps complaining about "Error Object Expected"
and stuff like that. I've run it through Firefox's Java Console, and
it comes back with no errors. Any pointers on this, would be much
appreciated.
<script type="text/javascript">
<!--
var p = new Array(0,0,0,0,0 )
var c = new Array(0,0,0,0,0 ,0,0,0,0)
var classes = new Array(5)
classes[0] = "<a href='javascrip t:class(0)'>ASM 2O<\/a><div
id='c0'><\/div><a href='javascrip t:class(1)'>PPL 2O<\/a><div
id='c1'><\/div>"
classes[1] = "<a href='javascrip t:class(2)'>SNC 2D<\/a><div
id='c2'><\/div><a href='javascrip t:class(3)'>CHC 2D<\/a><div
id='c3'><\/div>"
classes[2] = "<a href='javascrip t:class(4)'>ENG 2D<\/a><div
id='c4'><\/div><a href='javascrip t:class(5)'>MPM 2D<\/a><div
id='c5'><\/div>"
classes[3] = "<a href='javascrip t:class(6)'>bre ak<\/a><div
id='c6'><\/div>"
classes[4] = "<a href='javascrip t:class(7)'>GLC 2O<\/a><div
id='c7'><\/div><a href='javascrip t:class(8)'>BBI 2O<\/a><div
id='c8'><\/div>"
var hom = new Array(8)
hom[0] = "<ul><li>Mo tion tweening<\/li><li>Shape
tweening<\/li><li>Splice<\/li><li>Motion guides<\/li><\/ul>"
hom[1] = "<ul><li>Stuff< \/li><\/ul>"
hom[2] = "<ul><li>Megatr ansect II<\/li><li>Workshee t<\/li><li>10.3
#1-14<\/li><\/ul>"
hom[3] = "<ul><li>Stuff< \/li><\/ul>"
hom[4] = "<ul><li>Re ad 2.1<\/li><li>Redo journal<\/li><\/ul>"
hom[5] = "<ul><li>Stuff< \/li><\/ul>"
hom[6] = "<ul><li>Yo u think you can get homework from a lunch
period?<\/li><\/ul>"
hom[7] = "<ul><li>Techno logy careers presentation<\/li><\/ul>"
hom[8] = "<ul><li>Stuff< \/li><\/ul>"
function display(period) {
if(p[period]==0){
document.getEle mentById("p"+pe riod).innerHTML =classes[period]
p[period]=1
}
else{
document.getEle mentById("p"+pe riod).innerHTML =""
p[period]=0
}
}
function class(num){
if(c[num]==0){
document.getEle mentById("c"+nu m).innerHTML=ho m[num]
c[num]=1
}
else{
document.getEle mentById("c"+nu m).innerHTML=""
c[num]=0
}
}
//-->
</script>
----------------------------------------------------------------------------
You can see the script in context here:
The gist of it, is that a link is clicked which calls display(period) .
This will then display the appropriate element from classes[] which in
turn provides a link that calls class(num) and displays the
corresponding element from hom[]
Again, works nice on Firefox.
Internet Explorer:
Upon loading, it gives this error:
Line: 42
Char: 10
Error: Expected '('
Code: 0
And when clicking one of the links it gives this error
Line: 1
Char: 1
Error: Object Expected
Code: 0
Comment