Results 1 to 2 of 2

Thread: IE 7 - object does not support this property or method

  1. #1
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IE 7 - object does not support this property or method

    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.
    Last edited by Silver65; 02-29-2012 at 06:04 PM.

  2. #2
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok after a bit more investigation (Google searches) I believe I narrowed it down to the use of .indexOf() as it is only supported past IE 9.

    I changed "var index = mediaSelect.indexOf(chk[i].name);" to "var index = $.inArray(chk[i].name, mediaSelect);" Seems to work out. Gracious to...me. Hope this may help others though.
    Last edited by Silver65; 02-29-2012 at 06:36 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •