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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:51:19+00:00 2026-06-13T08:51:19+00:00

UPDATE: The problem is caused by including an old version of jQuery(1.4.2). After I

  • 0

UPDATE:

The problem is caused by including an old version of jQuery(1.4.2).
After I use 1.8.2 instead, the problem is just gone. But I still don’t
know why.

I recently made a Chrome extension. Thanks to the post chrome extension insert content script on browser action I realized that I have to include a js file like:

<script src="popup.js"></script>

But later I figure out it seems you cannot include more than one file:

<html>
  <head>
    <script src="jquery.js"></script> <!-- NOT LOADED -->
    <script src="popup.js"></script> <!-- LOADED -->
  </head>
  <body>
  </body>
</html>

What’s worse for me is that I cannot access the DOM of the popup HTML in the JS file. Like:

popup.html

<html>
  <head>
    <script src="popup.js"></script>
  </head>
  <body>
    <a id="intro" href="#"  target="_blank">Intro</a>
  </body>
</html>

popup.js

/*
  ... jQuery Codes here ... 
  jquery.js cannot be included via src="jquery.js" 
  but by copy and paste its source code here it works
*/
$("#intro").click(function(){
  alert("clicked"); // Not fireing at all
});

I am wondering what I can do to fix this. Thanks very much!

  • 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-13T08:51:20+00:00Added an answer on June 13, 2026 at 8:51 am

    Here is a basic example of what you could use to get it working. My best guess is that it only appeared that jQuery wasn’t loading because of how your popup.js is set up (it is trying to attach the click functionality before the element has loaded). I’m no JS expert, so I’m sure others will have better ideas of how to wait for the DOM to load, but this works as a basic test (NOTE: this uses a local version of the latest version of jQuery (1.8.2 currently), as the new content policies in manifest 2 do not allow in-line scripts):

    Manifest.json

    {
      "name": "Test Extension",
      "version": "1.0",
      "manifest_version": 2,
      "description": "Testing",
    
      "browser_action": {
        "default_icon":   "my_icon.png",
        "default_title":  "My Text Extension",
        "default_popup":  "popup.html"
      },
    
      "permissions": [
        "tabs", "http://*/", "https://*/"
      ]
    }
    

    Popup.html

    <html>
      <head>
        <script type="text/javascript" src="jquery.min.js"></script>
        <script type="text/javascript" src="popup.js"></script>
      </head>
      <body>
        <a id="intro" href="#"  target="_blank">Intro</a>
      </body>
    </html>
    

    Popup.js

    /*
       Here we wait for the body of the popup to load before
       attaching our functionality
    */
    window.onload = function() {
      $("#intro").click(function(){
        alert("clicked"); // Should fire now
      });
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update II Problem Solved but Why? This has been the biggest headache ever. My
I just discovered this problem today, and I had no idea what caused this
It is really strange, but since the update to SDK version 20, the graphical
UPDATE: Problem located in my related question - Nokogiri performance problem I am having
I am having a binding update problem with my ComboBox. My ComboBox's ItemSource is
UPDATE: First problem solved, second one described at the bottom of this post. UPDATE2:
Update : The problem appears to have been corrupt DLLs somewhere in my PHP
UPDATE It looks like this problem has been quietly fixed in iOS 4.3. Up
[Update]: my initial example doesn't reflect my problem. Updated the sample, hopfully it is
UPDATE: I've realized that the below problem only occurs if the user has already

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.