Signature Bookmarklet |
Signature Bookmarklet |
denmarks |
Aug 19 2009, 10:41 AM
Post
#1
|
Advanced Member Group: Members Posts: 207 Joined: 17-January 08 Member No.: 4,734 |
I add a signature to many forums by using a bookmarklet. It just combines existing text with the signature. I must hard code each text box name to do it and it gets extremely complicated. Below is the bookmarklet. Is there a way to modify it so that it uses the text box with the cursor in it rather than a named one?
This one looks for "answer", "textarea2", "pmesg", and "answertext". I hate to keep adding more. java script:try{document.getElementsByName('answer')[0].value+='\n\n%E2%82%AA%20%C9%A6%C9%99l%CA%9E%C9%B9%C9%90q%20%E2%82%AA'}catch(err){try{document.getElementsByName('textarea2')[0].value+='\n\n%E2%82%AA%20%C9%A6%C9%99l%CA%9E%C9%B9%C9%90q%20%E2%82%AA'}catch(err){try{document.getElementsByName('pmesg')[0].value+='\n\n%E2%82%AA%20%C9%A6%C9%99l%CA%9E%C9%B9%C9%90q%20%E2%82%AA'}catch(err){document.getElementsByName('answertext')[0].value+='\n\n%E2%82%AA%20%C9%A6%C9%99l%CA%9E%C9%B9%C9%90q%20%E2%82%AA'}}};void%200 |
Christian J |
Aug 19 2009, 12:03 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
I add a signature to many forums by using a bookmarklet. It just combines existing text with the signature. Can't you enter the signature through your forum profile? QUOTE This one looks for "answer", "textarea2", "pmesg", and "answertext". I hate to keep adding more. If there's just one TEXTAREA on the page you might look for CODE document.getElementsByTagName('textarea')[0] |
denmarks |
Aug 19 2009, 02:38 PM
Post
#3
|
Advanced Member Group: Members Posts: 207 Joined: 17-January 08 Member No.: 4,734 |
Thanks. That seems to work.
This post has been edited by denmarks: Aug 19 2009, 02:47 PM |
Lo-Fi Version | Time is now: 26th April 2024 - 01:45 PM |