You want to look at the Generated Source, not the normal Source FF
started with.  FF doesn't update that view as JS changes are made, so
it's pointless to check that.  Firebug or the Web Developers Toolbar
would help you out a lot.

-ALEX

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of digital spaghetti
Sent: Friday, December 01, 2006 6:51 AM
To: jQuery Discussion.
Subject: Re: [jQuery] Using .addClass() to add dynamic class not for CSS

Paul,

Actually it is working, Firebug has confirmed it for me, I was trying
to view source in firefox.  I just hope this means that MicroID
checked can still pick it up

Tane

On 12/1/06, Paul McLanahan <[EMAIL PROTECTED]> wrote:
> I don't know if this is the problem or not, but I do notice a type-o
> in your script:
>
> You have:
> $("[EMAIL PROTECTED]").addClass("microid-' . $hash . '")
>
> Should be:
> $("[EMAIL PROTECTED]'node']").addClass("microid-' . $hash . '")
>
> Notice the quotes around "node". I also switched your match from *= to
> ^= because from your example it appears you were looking for the ID
> attrib to start with "node".  But the *= should work fine as well.  My
> quess is that it was the lack of quotes around "node" that's the
> trouble.  addClass is the correct method to use, I just think that
> your query isn't finding any nodes.
>
> Hope this helps,
>
> Paul
>
> On 12/1/06, digital spaghetti <[EMAIL PROTECTED]> wrote:
> > Hey folks,
> >
> > I am working on a Microcontent module for Drupal that uses jQuery,
but
> > I cannot seem to get that functionality to work.  I need to ask,
does
> > .addClass actually add class text to a tag, or is it just applying
it
> > in the background.  To explain, my code looks like this:
> >
> > $(function(){
> >      $("[EMAIL PROTECTED]").addClass("microid-' . $hash . '")
> > });
> >
> > Now, $hash is generated from hashing the users email and homepage
url.
> >  When I add the JS to drupal_add_js, this is how it outputs, so I
know
> > this bit is working:
> >
> > <script type="text/javascript">
> > $(function(){
> >
$("[EMAIL PROTECTED]").addClass("microid-48d0e28087a9cb825fbc7e6257fdb00137
bf8aa3")
> > });
> > </script>
> >
> > But when I check any div tags that have <div id="node-n"> (n being
the
> > node number) the class list still looks the same.  If .addClass is
the
> > wrong thing, can anyone suggest another way I go about this?
> >
> > Regards,
> > Tane
> >
> > _______________________________________________
> > jQuery mailing list
> > discuss@jquery.com
> > http://jquery.com/discuss/
> >
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to