Re: fix: name="id" bug

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: fix: name="id" bug

Franck Marcia
@Gilles,

I saw you committed this fix to the repository.

For xpath queries, I can propose to change:
        return o[a] || o.getAttribute(a) || '';
into:
        return o.attributes[a] && o.attributes[a].nodeValue || o[a] || '';
on line 515.

It works fine for @id= @id!= and @id with both FF and IE (you can have
a look at my test page).

But I didn't check neither other operators nor other browsers.
Furthermore, I don't know if there's any regression. It's worth
running some kind of unit tests before committing it.

Cheers,

Franck.

2006/6/5, Franck Marcia <[hidden email]>:

> Hi,
>
> The current solution didn't fix the bug for all queries and all browsers.
>
> I found this way to solve it with IE (6 and 7b2) for queries like $('#myform'):
>
> replace:
>         '#': "a.getAttribute('id') == m[2]",
> with:
>         '#': "a.attributes['id'].nodeValue == m[2]",
> on line 414 (from current http://jquery.com/src/dev/sane/)
>
> It works with FF 1.5 too. I don't know for Safari, Opera and other
> browsers but you can use this test page:
> http://fmarcia.info/jquery/nameandid/test.html
>
> For queries like $("form[@id='myform']"), you'll have to modified the
> return value of $.attr. But any modification will imply a lot of tests
> because $.attr is heavily used in jquery.
>
> Happy debugging,
>
> Franck.
>

_______________________________________________
jQuery mailing list
[hidden email]
http://jquery.com/discuss/
Reply | Threaded
Open this post in threaded view
|

filter() function ignores end() function?

stefan flick
short question,

in my tests i figure out that the filter() function modifys the original query result and i'm not able to reset the result with end().

example not working:
  $("#mytab>tbody>tr").filter(":even").addClass("even").end()
    .filter(":odd").addClass("odd").end();

also not working:
  var rows = $("#mytab>tbody>tr");
  rows.filter(":even").addClass("even").end();
  rows.filter(":odd").addClass("odd").end();

works but redundand query:
  $("#mytab>tbody>tr").filter(":even").addClass("even");
  $("#mytab>tbody>tr").filter(":odd").addClass("odd");

is this a bug or the behavior like the filter() function is designed? would be nice if the original result can be restted with the end() function.

regards stefan

--


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

_______________________________________________
jQuery mailing list
[hidden email]
http://jquery.com/discuss/