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-48d0e28087a9cb825fbc7e6257fdb00137bf8aa3")
> });
> </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/

Reply via email to