Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8184481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:31:08+00:00 2026-06-07T01:31:08+00:00

I’m working on a bookmarklet which needs access to jquery-ui as well as jquery

  • 0

I’m working on a bookmarklet which needs access to jquery-ui as well as jquery min. The concern of course being that the page may already have jQuery loaded and conflicts should be avoided.

Using Ben Alman’s code at found at http://benalman.com/code/javascript/jquery/jquery.ba-run-code-bookmarklet.js I’ve been able to gracefully introduce jQuery and hacked in UI to load as well but there seems to be an issue with the delay and jQuery UI is not ready to go right away…

Is there a better way to handle loading both scripts in sequence before executing the actual code?

(function( window, document, jQuery, req_version, callback, callback_orig, parent, script ){

  if ( !window[jQuery] || req_version > window[jQuery].fn.jquery ) {
    parent = document.documentElement.childNodes[0];
    script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js';
    parent.appendChild(script);

    callback_orig = callback;
    callback = function($, L) {
      '$:nomunge, L:nomunge';
      $(script).remove();
      callback_orig( $, L );
    };
  }

  if (typeof jQuery.ui == 'undefined'){
   parent = document.documentElement.childNodes[0];
   scriptui = document.createElement('script');
   scriptui.type = 'text/javascript';
   scriptui.src = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.js';
   parent.appendChild(scriptui);
   alert('Loading your matches...');
  } 

  (function loopy($){
    '$:nomunge'; // Used by YUI compressor.

    ( $ = window[jQuery] ) && req_version <= $.fn.jquery
      ? callback( parent ? $.noConflict(1) : $, !!parent ) : setTimeout( loopy, 50 );
  })();

})( window, document, 'jQuery', '1.3.2',

 function($,L) {
    '$:nomunge, L:nomunge';   

<all the jquery stuff goes here>

There’s a similar question at Using jQuery UI in a Bookmarklet with in-depth answers but I have been unable to translate this from CoffeeMarklet to “standard” js.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:31:10+00:00Added an answer on June 7, 2026 at 1:31 am

    See my gist here – This is a bookmarklet template for loading jQuery, but you can specify additional scripts and css to load before execution.

    https://gist.github.com/2897748

    You initialise it like this.

    Edit: If you need to load dependencies, you can create an array and push things into it depending on different conditions.

    var jsDependencies = [];
    
    // This will only load jQuery UI if it does not exist already.
    // Of course if you rely on the page's copy, you have to do some 
    // more advanced things to check for versions and whatnot.
    if(!window.jQuery || !window.jQuery.ui){
      jsDependencies.push('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js');
    }
    
    var MyBookmarklet = MyBookmarklet || new Bookmarklet({
      // debug: true, // use debug to bust the cache on your resources
      css: ['/my/style.css'],
      js: jsDependencies,
      // jqpath: '/my/jquery.js', // defaults to google cdn-hosted jquery
      ready: function(base) { // use base to expose a public method
        base.init = function(){
          // doStuff();
        }    
        base.init();
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.