r/howdoesthiswork Jul 10 '14

Tutorial How Does One Create "bookmarklets" in Safari on an iPad?

http://www.ipadforums.net/threads/guide-creating-safari-bookmarklets.72353/
1 Upvotes

2 comments sorted by

2

u/TarbuckTransom Jul 25 '14 edited Jul 25 '14

Not all of those work...
e: It was a character issue. If I retype all the special characters they work.
e2: Nope, even with some corrections the view source one still doesn't work.

Here's one I use that shows alt text when you run it and then tap on something:

javascript:for(var%20imCt=0;document.images%5BimCt%5D;imCt++)%7Bvoid(document.images%5BimCt%5D.onclick=function%20()%20%7Bif(this.title)%7Bif((window.brbanta=prompt('Image%20title%20text:n(Click%20OK%20to%20insert%20this%20text%20before%20the%20image)',this.title))&&this.parentNode)%7Bthis.parentNode.insertBefore(document.createTextNode('%20'+brbanta+'%20'),this);%7D%7Delse%20if(this.alt)%7Bif((window.brbanta=prompt('Image%20alt%20text:n(Click%20OK%20to%20insert%20this%20text%20before%20the%20image)',this.alt))&&this.parentNode)%7Bthis.parentNode.insertBefore(document.createTextNode('%20'+brbanta+'%20'),this);%7D%7D%20else%20%7Balert('There%20is%20no%20title%20or%20alt%20text%20for%20this%20image');%7D%7D);%7D