Benches iPhone

5

Javascript bookmarklets on the home screen

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I use a few javascript bookmarks to do quick searches. E.g.

javascript:window.location.href='http://us.imdb.com/find?s=all&q='+escape(prompt ('Search IMDb'));

To create these, I edit a normal bookmark in Safari, splice in the Javascript, and then sync the bookmark to the iPhone.

I'd like to put one of these on the home screen, but can't find a way move them from Safari or my normal bookmark list.

I realize I could put the javascript on an HTML page, and put the HTML page link on my homescreen, but I'd like to avoid the added latency of that middle tier. I'm also not interested in any solutions that require a jailbreak.

Thanks in advance for any suggestions.

5 replies

Sign in or join Beachball Help to reply.

  1. 0

    DaVBMan

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Try to see how http://springlets.com does it. They even have that same IMDB option.

  2. 0

    Andrew Sears

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Springlets uses an intermediate HTML page, which is what I'm hoping to avoid.

  3. 0

    DaVBMan

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Well the icons on the springboard dont run javascript, so they still have to launch Safari, thus be told to go someplace. So a page is going to be needed. Like you said, you don't want to jailbreak which I guess could allow you to edit the file for the webclip and enter in javascript as the URL for it. But...

  4. 0

    DaVBMan

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    The dial shortcuts don't use a page by them (once made). Maybe check out that route on how they put data in the URL.

  5. 0

    Andrew Sears

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks dude, that did it. The dial shortcuts are using a trick described here:

    http://blog.clawpaws.net/post/2007/07/16/Storing-iPhone-apps-locally-with-data-U RLs

    It is still basically an HTML page, but all of the HTML is base64 encoded into the URL, so you don't have to wait for EDGE to load your static javascript. This not only solves the problem at hand, but it serves as a good incentive to convert all of my little homebrew apps into pure AJAX/JSON with completely cached interfaces. I wonder how long it will let you make those b64 strings...