Bookmarklet problem |
Bookmarklet problem |
denmarks |
Nov 24 2008, 01:28 PM
Post
#1
|
Advanced Member Group: Members Posts: 207 Joined: 17-January 08 Member No.: 4,734 |
NOTE: Ignore the space between java and script. The forum editor inserts it.
java script:document.getElementsByName('textarea1')[0].value+='aaaa';void 0 java script:document.getElementsByName('textarea2')[0].value+='bbbb';void 0 I have these two bookmarklets. They add text to the end of existing text in a field. Sometimes the field textarea1 exists and I use the first one. At other times only the second field exists and I use the second bookmarklet. I would like to combine them. I have tried java script:document.getElementsByName('textarea1')[0].value+='aaaa';document.getElementsByName('textarea2')[0].value+='bbbb';void 0 but if there is no textarea1 it just ends and does not try textarea2. I there a way to have both parts and have it ignore any errors? This post has been edited by denmarks: Nov 24 2008, 01:29 PM |
Lo-Fi Version | Time is now: 25th April 2024 - 11:52 AM |