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

  • SEARCH
  • Home
  • 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 911383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:11:48+00:00 2026-05-15T17:11:48+00:00

I’m having trouble with jQuery not recognising elements on my page and throwing an

  • 0

I’m having trouble with jQuery not recognising elements on my page and throwing an error saying the elements I’m trying to select are null.

We are inserting our content into the following wrapper, which is supplied by the client:

http://www.ft.com/global/mm0802/ag/wrapper

The wrapper contains the following string:

<!-- ftplchol id="contentFixed" version="1.0" -->

which we replace with our content and then render the page.

This is a sample of our content: (the problem I’m having is described below it)

<script src="/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $('.ActionControl a').live("click", function () {
            $.get($(this).attr("href"), {}, function (result) {
                // do stuff with result
                });
            }, "html");

            return false;
        });
    });
</script>

<div class="ActionControl">
    <span>Fund Directory</span>

    <span>
        <a href="/funddirectory/DirectoryResult">A</a>
    </span>

    <span>
        <a href="/funddirectory/DirectoryResult/B">B</a>
    </span>

    <span>
        <a href="/funddirectory/DirectoryResult/C">C</a>
    </span>    
</div>

When I run my stuff outside the context of the wrapper, everything is fine. My code behaves as expected. But when I run the full page with our content inserted into the wrapper, the following line throws an error:

$('.ActionControl a').live("click", function () {

saying that $('.ActionControl a') is null. Specifically: Microsoft JScript runtime error: 'null' is null or not an object

It doesn’t make any sense though. $('.ActionControl a') couldn’t and shouldn’t be null because by the time the document is ready, <div class="ActionControl"> definitely exists on the page and it works when I don’t use the wrapper. I can see it with FireBug & the IE Dev toolbar.

Even if I try to get something like $('a') or $('div') (of which there are many on the page), it still throws the same error. I know jQuery is working though because the $(document).ready() function works..

Does anyone have any idea why this wouldn’t be working? Is there something in the wrapper that would prevent it from seeing my control, or any other controls?

  • 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-15T17:11:49+00:00Added an answer on May 15, 2026 at 5:11 pm

    When a jQuery selector matches no elements, it returns an empty array, not null. That implies that jQuery is not loaded. Your path “/Scripts/jquery-1.4.1.js” is probably not valid in the context of their “wrapper” page. Maybe use the google-hosted version of jQuery instead, which would work in all contexts:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    

    UPDATED:
    It just occurred to me that you might be getting a conflict with jQuery and another javascript library that uses the ‘$’ symbol. Try using jQuery’s “noConflict” mode ( http://api.jquery.com/jQuery.noConflict/ ) and see if it works in that context:

    $.noConflict();
    jQuery(document).ready(function($) {
        // Code that uses jQuery's $ can follow here.
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.