Maybe you're interested About this site or in some of my Projects or Articles. You might even be interested About me or My Friends. If all else fails head back Home.

Morethanseven is where plays with the web

Insert Dojo and YUI bookmarklets

December 8th, 2007

I’ve talked about having fun with jQuery using Jash and Firebug before after seeing Simon throw the Google homepage around at barcamp. I’m no more a one javascript framework person than a one programming language person and recently I’ve seen cool things I want to play with in lots of the main contenders.

I’ve put together a couple of bookmarklets which load YUI or Dojo from their respective content delivery networks and insert them into your current browser context. You can then play around with them in Jash or Firebug or any other Javascript console.

Dojo is particularly interesting here due to it’s cunning loading mechanism for additional parts of the framework. Basically you can gain access to the entire (huge) framework simply by using the bookmarklet and then dynamically loading the rest via the command line.

Insert Dojo

javascript:void(function(){
 var%20s=document.createElement('script');
 s.src='http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js';
 document.getElementsByTagName('head')[0].appendChild(s);
}())

Insert YUI

javascript:void(function(){
 var%20s=document.createElement('script');
 s.src='http://yui.yahooapis.com/2.4.0/build/yahoo-dom-event/yahoo-dom-event.js';
 document.getElementsByTagName('head')[0].appendChild(s);
}())

The code simply inserts a script element into the page which loads the relevant framework. I’ve shown the code on multiple lines for the sake of the example, but your bookmarklet should be on one line. Alternatively you can drag the Insert YUI or Insert Dojo links to your bookmark bar.

Popularity: 20%

Tagged , , , , ,

8 Responses to “Insert Dojo and YUI bookmarklets”

  1. Insert Prototype

    javascript:void(function(){
    var%20s=document.createElement(‘script’);
    s.src=’http://svn.rubyonrails.org/rails/spinoffs/scriptaculous/lib/prototype.js’;
    document.getElementsByTagName(‘head’)[0].appendChild(s);
    }())

  2. [...] Insert Dojo and YUI bookmarklets – Morethanseven Two cool little bookmarklets that allow you to add Dojo or YUI into any page. Very handy in combination with Jash. (tags: Dojo YUI Bookmarklets javascript) [...]

  3. [...] the natural extension of Gareth Rushgrove’s bookmarklets for inserting the Dojo or YUI Javascript toolkits mentioned by Simon, here’s a tidying-up of [...]

  4. [...] Morethanseven » Insert Dojo and YUI bookmarklets Between Jash and these, it’s getting easier and easier to insert your javascript toolkit of choice into arbitrary pages and explore/change to your heart’s content (tags: dojo jash javascript jquery remix yui) [...]

  5. [...] Morethanseven » Insert Dojo and YUI bookmarklets (tags: javascript Development yui lazycoder) Post a comment — Trackback URI RSS 2.0 feed for these comments This entry (permalink) was posted on Monday, December 10, 2007, at 3:21 am by Scott and categorized in General. [...]

  6. [...] Morethanseven » Insert Dojo and YUI bookmarklets A simple bookmarklet to insert Dojo into the page you’re viewing. Combine this with Jash and you have access to all kinds of debugging and manipulation power. (tags: bookmarklets debugging dojo javascript webdev) [...]

  7. [...] for Loading YUI: Gareth Rushgrove blogs about a bookmarklet he created to insert YUI or Dojo on any page you’re browsing: "I’ve put together a couple of bookmarklets which load YUI or Dojo from their [...]

  8. [...] Insert Dojo and YUI bookmarklets [...]

Leave a Reply