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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:23:46+00:00 2026-06-15T11:23:46+00:00

I am developing a firefox plugin using jQuery. I added a page load listener

  • 0

I am developing a firefox plugin using jQuery. I added a page load listener and loading jQuery javascript file inside that function.

   onPageLoad: function(aEvent) {
        var doc = aEvent.originalTarget; // doc is document that triggered the event
        var win = document.defaultView; // win is the window for the doc

        var jsLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
        jsLoader.loadSubScript("chrome://myExt/content/jquery-1.8.0.js");

There is no error in loading the jQuery. But, when I am trying to modify DOM using jQuery or make any DOM searches etc., it fails

if($("#id1").length>0) // length is always 0
// do something

var x  = document.getElementById("id1"); //plain old javascript and it works

I am able to do everything using javascript just fine. But, doing the same with jQuery fails without any error. Any idea what may be going wrong here?

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-06-15T11:23:47+00:00Added an answer on June 15, 2026 at 11:23 am

    I found the solution for this. jQuery loading is fine and able to do non-DOM related functions without any issues. But, $ is failing to do anything with DOM as the function needs to be modified.

    $ = function(selector,context) {
    return new jQuery.fn.init(selector,context||doc);
    };
    

    Here, “doc”is the document. After making this change, everything fell in place.

    @everone, thanks for your comments. I did not see the responses earlier. If not, I would have gladly responded back.

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

Sidebar

Related Questions

I am developing a firefox plugin. When i am using debug mode dll ,it
I am developing a mobile website. I am using Jquery mobile and iscroll plugin.
I am developing a Firefox extension that uses XSL transformations. I have been using
I'm developing a firefox plugin and i fetch web pages to do some analysis
While developing a firefox extension, I create a wizard window from overlay.js using: this.wizard
I'm developing a Firefox extension, and I have a toolbar button that displays an
I'm currently developing a firefox extension which checks some server side XML-File on a
I'm developing firefox sidebar that interacts with the main browser window. When a button
I am developing my first addon for Firefox, and I'm using the Extention Developer
I'm developing a Firefox extension and have the following code: function initialize() { //

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.