+ Reply to Thread
Results 1 to 5 of 5

Thread: Property not supported

  1. #1
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Property not supported

    This code works perfectly in Firefox bu gives errors deselecting in IE 8. Why does this code give a property not supported error on line 10 char 3?
    Code:
    var selected = Array();
    
    function $(id) {
        return document.getElementById(id);
    }
    
    function imgSelect() {
        if (this.className == "selected") {
          //Error line below
           selected.splice(selected.indexOf(this.id), 1);
            document.modify.to_delete.value = selected.join("|");
            this.className = null;
        } else {
            selected[selected.length] = this.id;
            document.modify.to_delete.value = selected.join("|");
            this.className = "selected";
        }
    }
    
    var imgs = $("image_box").getElementsByTagName("img");
    for (x in imgs) {
        imgs[x].onclick = imgSelect;
    }
    Which works this HTML:
    HTML Code:
    <input type="hidden" name="to_delete" value="" />
    <div id="image_box">
       <img src="/images/Test Item 22/thumbnails/Desert.jpg" alt="Desert.jpg" title="Delete?" id="Desert.jpg" />
       <img src="/images/Test Item 22/thumbnails/I Love You.png" alt="I Love You.png" title="Delete?" id="I Love You.png" />
       <img src="/images/Test Item 22/thumbnails/Jellyfish.jpg" alt="Jellyfish.jpg" title="Delete?" id="Jellyfish.jpg" />
       <img src="/images/Test Item 22/thumbnails/Lighthouse.jpg" alt="Lighthouse.jpg" title="Delete?" id="Lighthouse.jpg" />
       <img src="/images/Test Item 22/thumbnails/Penguins.jpg" alt="Penguins.jpg" title="Delete?" id="Penguins.jpg" />
       <img src="/images/Test Item 22/thumbnails/Tulips.jpg" alt="Tulips.jpg" title="Delete?" id="Tulips.jpg" />
    </div>
    Last edited by Twinkie; 01-19-2010 at 12:10 PM.

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Property not supported

    selected.splice(selected.indexOf(this.id), 1);
    Pretty sure indexOf is not supported by IE.
    Nothing is always absolutely so.

  3. #3
    slacker3 is offline x10 Sophmore slacker3 is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    146

    Re: Property not supported


  4. #4
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: Property not supported

    That is severely disappointing. I have noticed IE's issues with compliance, but I never had an issue with support :thefinger

    Thanks very much for the quick response, you saved me a good 30 minutes of headache

  5. #5
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: Property not supported

    Quote Originally Posted by Twinkie View Post
    That is severely disappointing. I have noticed IE's issues with compliance, but I never had an issue with support :thefinger
    Well, indexOf is a "new" Array property. (JavaScript 1.6, ECMA 5th edition)
    Nothing is always absolutely so.

+ Reply to Thread

Similar Threads

  1. Is SSL supported in Stoli server?
    By neverdark in forum Free Hosting
    Replies: 3
    Last Post: 09-14-2008, 03:30 AM
  2. It works! ...
    By bpakidz in forum Programming Help
    Replies: 4
    Last Post: 09-07-2008, 11:12 PM
  3. Trying to get property of non-object
    By slpixe in forum Programming Help
    Replies: 4
    Last Post: 08-28-2008, 06:20 PM
  4. PHP mail supported?
    By bchs58 in forum Free Hosting
    Replies: 4
    Last Post: 10-14-2007, 11:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers