Silver65
02-29-2012, 05:58 PM
Now I've seen a few threads about this error and how in most cases it was a simple issue of declaring a variable with "var". However, if you take a look at the code below I don't think that is exactly the issue.
The var that IE is having trouble with I believe is mediaSelect, but as you can see I declared it outside of the function as another function also accesses this array.
var mediaSelect = new Array();
function DoCheckAll(chkAll)
{
var tbl = document.getElementById('tblMediaTypes');
var chk = tbl.getElementsByTagName('input');
for (var i=1; i<chk.length; i++)
{
chk[i].checked = chkAll.checked;
if (!chk[i].checked)
{
var index = mediaSelect.indexOf(chk[i].name);
if(index != -1)
mediaSelect.splice(index, 1);
}
else
{
var index = mediaSelect.indexOf(chk[i].name);
if(index == -1)
mediaSelect.push(chk[i].name);
}
}
}
So does anyone have any ideas / suggestions? If you need more details please let me know.
I have checked out this page on a MAC using Chrome 17.0.963, Firefox 3.5.16, and Safari 5.0.4. - All which work fine
I just tried checking this out on a PC using IE 7 and it doesn't work while returning the error. It did work on Firefox 2.0. The PC I'm forced to use is a POS so checking with any other browser would require 3 hours to install it.
The var that IE is having trouble with I believe is mediaSelect, but as you can see I declared it outside of the function as another function also accesses this array.
var mediaSelect = new Array();
function DoCheckAll(chkAll)
{
var tbl = document.getElementById('tblMediaTypes');
var chk = tbl.getElementsByTagName('input');
for (var i=1; i<chk.length; i++)
{
chk[i].checked = chkAll.checked;
if (!chk[i].checked)
{
var index = mediaSelect.indexOf(chk[i].name);
if(index != -1)
mediaSelect.splice(index, 1);
}
else
{
var index = mediaSelect.indexOf(chk[i].name);
if(index == -1)
mediaSelect.push(chk[i].name);
}
}
}
So does anyone have any ideas / suggestions? If you need more details please let me know.
I have checked out this page on a MAC using Chrome 17.0.963, Firefox 3.5.16, and Safari 5.0.4. - All which work fine
I just tried checking this out on a PC using IE 7 and it doesn't work while returning the error. It did work on Firefox 2.0. The PC I'm forced to use is a POS so checking with any other browser would require 3 hours to install it.