#951 ✓help_request
mary_fisher

Cannot call Element.down() with parameter

Reported by mary_fisher | November 29th, 2009 @ 05:34 PM

This seems to be related to a similiar bug that I just discovered here:

As long as I just called elm.down() it worked fine, but as soon as I put some String in there (like 'span' oder 'div') FF and IE8 - but not IE6.- threw an error.

FF:"An invalid or illegal string was specified"
Line: 3299

(elm.down().next('span') worked fine though.)

(My version is 1.6.1.)

Comments and changes to this ticket

  • mary_fisher

    mary_fisher November 29th, 2009 @ 05:35 PM

    • Tag changed from down, section:dom to bug, section:dom
  • Tobie Langel

    Tobie Langel February 25th, 2010 @ 09:40 PM

    • Tag changed from bug, section:dom to section:dom
  • Tisho Georgiev

    Tisho Georgiev March 1st, 2010 @ 04:15 PM

    • State changed from “new” to “works_for_me”
    • Tag changed from section:dom to needs:failing_testcase, section:dom

    I just tried this in FF 3.6, IE8 and Safari 4 and it's working fine. Can you, please, provide a failing testcase?

    Thanks for taking the time to contribute.

  • mary_fisher

    mary_fisher March 2nd, 2010 @ 10:14 AM

    It worked before, so I was baffled, when it suddenly didn't work for me anymore. I'll try to find the example, but I'm not sure, what exactly you need. The js-file obviously. What about the html?

  • Tisho Georgiev

    Tisho Georgiev March 2nd, 2010 @ 10:34 AM

    Yes, just zip up the html, the js and the version of prototype you're using, attach them to this ticket and we'll try to figure out what's going on. Thanks!

  • mary_fisher

    mary_fisher March 2nd, 2010 @ 11:17 AM

    I'm not sure, if this is enough or helpful. These are just parts since I figured you wouldn't need anything not related to the problem. Let me know if you need more. I'll try to make this also available online.

  • mary_fisher
  • Tisho Georgiev

    Tisho Georgiev March 2nd, 2010 @ 12:38 PM

    • State changed from “works_for_me” to “help_request”

    I did some quick tests on the live site you provided and it turns out that the HTML you're outputting is really malformed, which is probably why you're experiencing these problems. Look at the id attribute of each div.article you have. They're named using numbers only, which isn't allowed in HTML. The naming rules for id's are:

    • Must begin with a letter A-Z or a-z
    • Can be followed by: letters (A-Za-z), digits (0-9), hyphens ("-"), underscores ("_

    Try to change the generated ids to something like article_1 and see if it works. Another thing I noticed is that you've tried to put block elements (

    ,

    ) inside an inline element like , which is also invalid. You can try using an HTML validator to get rid of these errors.

    Hope it helps,
    -T

  • Bryan Larsen

    Bryan Larsen March 2nd, 2010 @ 05:16 PM

    That was my problem too -- I had "[" and "]" in my id's. Once I got rid of them, this problem went away.

  • mary_fisher

    mary_fisher March 3rd, 2010 @ 10:25 AM

    I'll change that and test again. I'm curious though why elm.next("span") worked but elm.down("span") didn't.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

Attachments

Pages