jQuery: The Write Less, Do More JavaScript Library

Attributes filters not always working when using a context

View: New views
4 Messages — Rating Filter:   Alert me  

Attributes filters not always working when using a context

by jidé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello all,

I realized attributes filters do not work when a context is passed in
some cases :
$(span[style*='font-size: x-small'] > strong, context);

Simpler selectors work (span[attribute] e.g.), so i came to the
conclusion that it is the combination of a complex attribute filter
and a context which is (sometimes) buggy. I also verified it is not
because of changes in the DOM (the node exists and has the attribute).

I am not sure why precisely it does not work in my case, but if it can
help, here is the scenario in which this happens :
- I have a div with some markup in it.
- I pass the div node as a reference to a function which traverses the
div according to some selectors (some simple, and some more complex).
Simple selectors work fine, but selectors with attribute filters do
not. If i remove the context, complex filters work fine.

Is this a known bug ? Any idea ?

In my case I found a workaround, but i thought sharing this with you
might be useful.

Thank you !

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Attributes filters not always working when using a context

by jidé :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Nobody on this ?...

It is definitely a bug, I can't believe no one encountered this
problem...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Attributes filters not always working when using a context

by ricardobeat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm sure someone would be able to help if you provided a test page.

On Oct 21, 9:26 pm, jidé <jide...@...> wrote:
> Nobody on this ?...
>
> It is definitely a bug, I can't believe no one encountered this
> problem...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Attributes filters not always working when using a context

by gMinuses :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I've encountered it before, but unable to narrow it down:
http://groups.google.com/group/jquery-dev/browse_thread/thread/d441bfec2c6850fa

On Oct 22, 7:26 am, jidé <jide...@...> wrote:
> Nobody on this ?...
>
> It is definitely a bug, I can't believe no one encountered this
> problem...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---