Tips for quickly add a librarie to a website to do some tests with Firebug
As I'm currently working on an Archetype based Maven site for the next archetypejs.org, I had to check some features of EJS template.
I wanted to check that Prototype or jQuery "each" syntax would be available in my template. So I decided to use a bookmarklet to insert one of them dynamically in the embeddedjs.org :
- Prototypize
The code : "javascript:(function(){var head,script; if(!document.getElementById('prototype.js')){head=document.getElementsByTagName('head')[0]; script=document.createElement('script'); script.type='text/javascript'; script.src='http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js'; script.id='prototype.js'; head.appendChild(script);}})(); void(0);"
- jQuerize :
the code : "javascript:(function(){var head,script; if(!document.getElementById('jquery.js')){head=document.getElementsByTagName('head')[0]; script=document.createElement('script'); script.type='text/javascript'; script.src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.js'; script.id='jquery.js'; head.appendChild(script);}})(); void(0);"
How to use these bookmarklets ? Just drag and drop them into your bookmarks, then when you need to add Prototype or jQuery on a site, click on the corresponding "Prototypize" or "jQuerize" in your bookmarks, then open you Firebug console and you can use them :)


0 commentaires:
Enregistrer un commentaire