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 5847843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:46:34+00:00 2026-05-22T12:46:34+00:00

This is my current bookmarklet code. if (1 == 1) { var jQ =

  • 0

This is my current bookmarklet code.

if (1 == 1) {
    var jQ = document.createElement('script');
    jQ.type = 'text/javascript';
    jQ.onload=runthis;
    jQ.src = 'http://www.domain.com/jquery-1.5.2.min.js';
    document.head.appendChild(jQ);
}

I want to call multiple jQ.src. I tried this however it doesn’t work on some sites.

This is my current bookmarklet code.

if (1 == 1) {
    var jQ = document.createElement('script');
    jQ.type = 'text/javascript';
    jQ.onload=runthis;
    jQ.src = 'http://www.domain.com/jquery.js';
        jQ.src = 'http://www.domain.com/jquery2.js';
    document.head.appendChild(jQ);
}

On some sites it works and other it doesn’t Any insight?

Thanks!

  • 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-05-22T12:46:35+00:00Added an answer on May 22, 2026 at 12:46 pm

    Are you sure that works on some sites? I think you’re just getting lucky and picking up the site’s already loaded jQuery.

    Anyway, if you want to add two JavaScript files then you’ll have to append two script tags:

    var jQ  = document.createElement('script');
    jQ.type = 'text/javascript';
    jQ.src  = 'http://www.domain.com/jquery.js';
    document.head.appendChild(jQ);
    
    jQ        = document.createElement('script');
    jQ.type   = 'text/javascript';
    jQ.src    = 'http://www.domain.com/jquery2.js';
    jQ.onload = runthis;
    document.head.appendChild(jQ);
    

    Also note that the onload is only on the second one since you presumably need both JavaScript files loaded before runthis will work.

    If you’re loading jQuery, you might want to check if the page has loaded it already:

    var jQ;
    if(typeof window.jQuery != 'function') {
        // jQuery isn't there yet so load it up.
        jQ      = document.createElement('script');
        jQ.type = 'text/javascript';
        jQ.src  = 'http://www.domain.com/jquery.js';
        document.head.appendChild(jQ);
    }
    jQ        = document.createElement('script');
    jQ.type   = 'text/javascript';
    jQ.src    = 'http://www.domain.com/jQuery2.js';
    jQ.onload = runthis;
    document.head.appendChild(jQ);
    

    Adding a jQuery.noConflict() call might be a good idea too, the page might be using $ for something else so forcing it to be jQuery could break the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a javascript bookmarklet that gets the current page's title and URL, using
i have this js bookmarklet that makes all the current page's font colors black.
Background: I have written a bookmarklet (JavaScript) that appends an iframe to the current
Background: I have written a bookmarklet (JavaScript) that appends an iframe to the current
I've developed a JavaScript Bookmarklet that have appended div to the current page. But
i'm making a bookmarklet to my website, and for now i have: <a href=javascript:location.href='http://website.com/compartir_link.php?url='+encodeURIComponent(location.href)
If I understand this correctly: Current CPU developing companies like AMD and Intel have
Is there a difference between Cursor.Current and this.Cursor (where this is a WinForm) in
I need a serviceable shell for MSYS. This is my current dilemma: The default
In the constructor of my class, I map the current object ( this ),

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.