This is hacked out of the iPastelet JavaScript bookmark (bookmarklet) from
http://mobilemind.net/___
But, I have no idea what using it will do to RAM usage or browser performance over time.
Code:
javascript:if(!top.name){top.name=location;alert(top.name+" - ready to paste!");}else{var i,j,oldtxt;var rtxt=top.name;for (i=0;i<document.forms.length;i++)for (j=0;j<document.forms[i].elements.length;j++){if (document.forms[i].elements[j].type=="textarea"){oldtxt=document.forms[i].elements[j].value;document.forms[i].elements[j].value=rtxt;var answer=confirm("Paste Here?");if (answer) break; else document.forms[i].elements[j].value=oldtxt;}}top.name="";}
What it does: When run takes the URL of the current window and saves it as a variable. Then when run again will look for "textarea" (unlike iPastelet's "text") form elements and ask in succession if you'd like to paste the info from the variable there and then clears it, readying it for another usage.
Why bother? Because sometimes I want to post a link here or elsewhere when using my iPhone but can't. Well, couldn't.
If any JavaScript experts want to chime in with any tips or warnings that would certainly be welcome. I'm honestly doubtful it's cleared out of RAM, but being nothing but fairly short strings shouldn't form a clot too soon.
Be aware that the "paste" function is actually setting the value of the form element.
Which means anything typed into the text area before pasting will be replaced! So run this before typing.
Seems my link doesn't want to work, so you're going to have to create a new bookmark in Safari with this script as the URL and then sync to your phone (or touch).
Well it seems this only works if used in the same "window." In other words, when you find a page you'd like to post the url to, get to where you want to post it using the same window.