Thanks for the reply Klaus

Both links matches if I, inside the function, do: if (this.href == src) and when I run the script and watch the output of the alert they also match. I tried your tip just to be sure though but it still doesn't exclude the matching href :-/

Did'nt know that different browsers gave a different href reply in _javascript_ if the links are relative though - thanks for the tip!

Regards
Jimmy

Mogrol schrieb:
  
Hi

I'm trying to get all links from the body in a page and in the same time 
excluding a single element with the matching href attribute using the 
:not css-selector but it does'nt seem to be working.

Is this not supported in the latest jQuery (1.0.1) or is there  
something wrong with my code? The _expression_ returns all links matching 
the rel but also returns the one with the matching href.

I know I could simply insert a: if (this.href != src) in the function to 
fix this but for my purposes the best way to do it is directly using jquery.

I'd be grateful for advices on this.

---

$('body [EMAIL PROTECTED]' + rel + ']:not([EMAIL PROTECTED]' + src +'])').each(function() {
   alert(this.href + '\n' + src);
});
    


Hi, maybe you ran into the problem that different browsers return 
different values for the href attribute if the value itself (in your 
html source) is a relative link.

If src is something like "/relative/path/to/somewhere" try the following 
snippet:

$('[EMAIL PROTECTED]' + rel + ']:not([EMAIL PROTECTED]' + src +'])').each(function() {
     alert(this.href + '\n' + src);
});

I think you can leave out the body selector here, links cannot occur 
outside the body anyway.

Or you can try to use the not function, but this should have the same 
result:

$('[EMAIL PROTECTED]' + rel + ']).not('[EMAIL PROTECTED]' + src +'])').each(function() {
     alert(this.href + '\n' + src);
});


-- Klaus

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

  

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

Reply via email to