In our previous video in the bookmarklet series we showed you how to create a simple bookmarklet where all the code was contained wholly within the bookmarklet itself.
What you'll Learn
The main reason you’d want to do this is so that you can update the bookmarklet without telling your users to manually update the bookmarklet themselves.
We’re going to create a bookmarklet that performs the same browser resizing as in the previous screencast, but this time instead of it being included in the bookmarklet itself, we’re including it from a remote source so that we can transparently update it to fix any bugs or include support for new browsers.
Then we need to create a
Then we want to append our
script tag to the
body of the document we’re on when the bookmarklet is pressed.
And that’s it. So let’s remove any indentations and returns and place that in our link.
Remember to include the
So once we drag the link into our bookmark bar, navigate to another page, and then press it, our bookmarklet works!
Next time we’ll show you how to use jQuery in your bookmarklet, so you can write less and do more!
Thanks for watching.