[jQuery] Re: Add extra content to the title attribute

2009-08-18 Thread Glödu

This does not work when there are multiple title-attribute to add
extra content, the original title from the first title element stay in
the other tiltes.

On 11 Aug., 07:18, Paul Collins pauldcoll...@gmail.com wrote:
 Thanks for your help guys, that worked a treat.
 You're right Liam, that was my bad, there was no add there, I meant
 attr, which was the wrong code anyways...

 Cheers again
 Paul

 2009/8/11 anurag pal mail.anurag@gmail.com



  Hi,

  Use prepend method.

  Regards,
  Anurag Pal

  On Tue, Aug 11, 2009 at 3:15 PM, Paul Collins pauldcoll...@gmail.comwrote:

  Hi all,
  This is hopefully simple. I have a bunch of links with titles, like
  TITLE=Facebook and so on. I am adding JQuery to make the links open in a
  new window and would like to add some text to the title that says this 
  link
  will open in a new window, whilst keeping the original text. I'm using the
  add JQuery command, but this actually replaces the original title text.

  $(a.newWindow).attr(title,  - This link will open in a new window);

  The end result I would like to have is: title=Facebook - This link will
  open in a new window.

  Could anyone point me in the right direction?!
  Cheers


[jQuery] Re: Add extra content to the title attribute

2009-08-18 Thread Glödu

This does not work when there are multiple title-attribute to add,
there it is only from the first title element transferred.

On 11 Aug., 07:18, Paul Collins pauldcoll...@gmail.com wrote:
 Thanks for your help guys, that worked a treat.
 You're right Liam, that was my bad, there was no add there, I meant
 attr, which was the wrong code anyways...

 Cheers again
 Paul

 2009/8/11 anurag pal mail.anurag@gmail.com



  Hi,

  Use prepend method.

  Regards,
  Anurag Pal

  On Tue, Aug 11, 2009 at 3:15 PM, Paul Collins pauldcoll...@gmail.comwrote:

  Hi all,
  This is hopefully simple. I have a bunch of links with titles, like
  TITLE=Facebook and so on. I am adding JQuery to make the links open in a
  new window and would like to add some text to the title that says this 
  link
  will open in a new window, whilst keeping the original text. I'm using the
  add JQuery command, but this actually replaces the original title text.

  $(a.newWindow).attr(title,  - This link will open in a new window);

  The end result I would like to have is: title=Facebook - This link will
  open in a new window.

  Could anyone point me in the right direction?!
  Cheers


[jQuery] Re: Add extra content to the title attribute

2009-08-11 Thread Liam Potter


something like this

var origTitle = $(a.newWindow).attr(title);
$(a.newWindow).attr(title, origTitle+ - This link will open in a 
new window);


Paul Collins wrote:

Hi all,

This is hopefully simple. I have a bunch of links with titles, like 
TITLE=Facebook and so on. I am adding JQuery to make the links open 
in a new window and would like to add some text to the title that says 
this link will open in a new window, whilst keeping the original 
text. I'm using the add JQuery command, but this actually replaces 
the original title text.


$(a.newWindow).attr(title,  - This link will open in a new window);

The end result I would like to have is: title=Facebook - This link 
will open in a new window. 


Could anyone point me in the right direction?!
Cheers





[jQuery] Re: Add extra content to the title attribute

2009-08-11 Thread Liam Byrne


Paul Collins wrote:

 I'm using the add JQuery command,
 $(a.newWindow).attr(title,  - This link will open in a new window);

I can't see any add there ?

The proper code would be 
$(a.newWindow).attr(title,$(this).attr(title)+ - This link will 
open in a new window);


L

Paul Collins wrote:

Hi all,

This is hopefully simple. I have a bunch of links with titles, like 
TITLE=Facebook and so on. I am adding JQuery to make the links open 
in a new window and would like to add some text to the title that says 
this link will open in a new window, whilst keeping the original 
text. I'm using the add JQuery command, but this actually replaces 
the original title text.


$(a.newWindow).attr(title,  - This link will open in a new window);

The end result I would like to have is: title=Facebook - This link 
will open in a new window. 


Could anyone point me in the right direction?!
Cheers




No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.50/2296 - Release Date: 08/11/09 06:10:00


  




[jQuery] Re: Add extra content to the title attribute

2009-08-11 Thread Peter Edwards
try this:

$(a.newWindow).attr(title, $(a.newWindow).attr(title)+ - This link
will open in a new window);

On Tue, Aug 11, 2009 at 10:45 AM, Paul Collins pauldcoll...@gmail.comwrote:

 Hi all,
 This is hopefully simple. I have a bunch of links with titles, like
 TITLE=Facebook and so on. I am adding JQuery to make the links open in a
 new window and would like to add some text to the title that says this link
 will open in a new window, whilst keeping the original text. I'm using the
 add JQuery command, but this actually replaces the original title text.

 $(a.newWindow).attr(title,  - This link will open in a new window);

 The end result I would like to have is: title=Facebook - This link will
 open in a new window.

 Could anyone point me in the right direction?!
 Cheers




[jQuery] Re: Add extra content to the title attribute

2009-08-11 Thread anurag pal
Hi,

Use prepend method.

Regards,
Anurag Pal

On Tue, Aug 11, 2009 at 3:15 PM, Paul Collins pauldcoll...@gmail.comwrote:

 Hi all,
 This is hopefully simple. I have a bunch of links with titles, like
 TITLE=Facebook and so on. I am adding JQuery to make the links open in a
 new window and would like to add some text to the title that says this link
 will open in a new window, whilst keeping the original text. I'm using the
 add JQuery command, but this actually replaces the original title text.

 $(a.newWindow).attr(title,  - This link will open in a new window);

 The end result I would like to have is: title=Facebook - This link will
 open in a new window.

 Could anyone point me in the right direction?!
 Cheers




[jQuery] Re: Add extra content to the title attribute

2009-08-11 Thread Paul Collins
Thanks for your help guys, that worked a treat.
You're right Liam, that was my bad, there was no add there, I meant
attr, which was the wrong code anyways...

Cheers again
Paul


2009/8/11 anurag pal mail.anurag@gmail.com

 Hi,

 Use prepend method.

 Regards,
 Anurag Pal


 On Tue, Aug 11, 2009 at 3:15 PM, Paul Collins pauldcoll...@gmail.comwrote:

 Hi all,
 This is hopefully simple. I have a bunch of links with titles, like
 TITLE=Facebook and so on. I am adding JQuery to make the links open in a
 new window and would like to add some text to the title that says this link
 will open in a new window, whilst keeping the original text. I'm using the
 add JQuery command, but this actually replaces the original title text.

 $(a.newWindow).attr(title,  - This link will open in a new window);

 The end result I would like to have is: title=Facebook - This link will
 open in a new window.

 Could anyone point me in the right direction?!
 Cheers