FFExt: Safely include jQuery in a browser overlay


/ Published in: JavaScript
Save to your folder(s)

If you just use a `` element in the overlay, the browser toolbars are reset to their default configuration (at least with jQ 1.3.2).


Copy this code and paste it in your HTML
  1. var _jq = "chrome://clpics/content/jquery-1.3.2.min.js"
  2.  
  3. // Load jQuery without messing with the toolbars.
  4. // Dunno why this is necessary, but it is and it works, so meh
  5. Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
  6. .getService(Components.interfaces.mozIJSSubScriptLoader)
  7. .loadSubScript(_jq);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.