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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:44:34+00:00 2026-05-13T11:44:34+00:00

I am trying to display a page that uses jQuery. The AJAX functionality implemented

  • 0

I am trying to display a page that uses jQuery. The AJAX functionality implemented in the page does not work.

I am using FF for debugging. When I look in the console panel, I see the following error: ‘jQuery is not defined’. Ah, that’s an easy one I think – maybe the jQuery file has not been included correctly, or not found etc. So I take a look at the HTML and click on the node – lo and behold, the jQuery script has been CORRECTLY included in the page.

Although none of the other js libraries in the pages where jQuery is referenced uses ‘$’ (like prototype), I have invoked the noConflict() method in the jQuery logic, just in case I use a conflicting library at a later stage.

[Edit]

I think the problem is related to the file that I am using jQuery in a templating environment (Symfony 1.4 to be precise). For those not familiar with the Symfony templating system, essentially, the view model is comprised of a ‘layout’ file (the template), which then gets decorated (decorator pattern), with other bits of information (lets call this ‘page content’).

The final page looks roughly something like this:

<html>
  <head>
  <script type="text/javascript" src= "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
  </head>
  <body>
   <!-- page contents go here -->
  </body>
</html>

I am loading jQuery into the template (i.e. the ‘layout’ in Symfony terminology).

The reasoning for this being that the JQ library is cached client side, and is available for the pages that require it. The dynnamic pages (whose content go into the ‘page content’ section of the layout), will then have their own jQuery logic. This (using the “wrapper function” idea provided in the answer by Mark Schultheiss below), looks like this:

<script type="text/javascript">
/*<![CDATA[*/
jQuery(function()
{
 jQuery.noConflict();
 jQuery(document).ready(function(){
  jQuery("div.tpaccordion div.accItem").hide();
  jQuery("#latestVideosHolder").show();
  jQuery("div.tpaccordion h3").click(function(){
   jQuery(this).next().slideToggle("slow")
   .siblings("div.accItem:visible").slideUp("slow");
   jQuery(this).toggleClass("active");
   jQuery(this).siblings("h3").removeClass("active");
  });
 });
});
/*]]>*/
</script>

**[Edit2]**Corrected the syntax error. Now I’m back to getting the jQuery is not defined error. 🙁

  • 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-13T11:44:35+00:00Added an answer on May 13, 2026 at 11:44 am

    It is running before the script/DOM is loaded.
    Put the jQuery.noconflict(); in a jquery wrapper

    jQuery(function()
    {
      jQuery.noConflict(); 
    });
    

    If you DO think you might need to protect yourself:

      (function($)
        {
          $.noConflict(); 
        })(jQuery);
    

    also works

    EDIT: Fixed some syntax errors

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

Sidebar

Related Questions

I've built a page using jQuery that uses an async Ajax call. I'm trying
I am currently trying to create a multi-page form that uses both jQuery and
I'm using plone and trying to display a form result in a page template.
I'm designing a template creation tool, which uses a jQuery Ajax request that posts
I'm trying to display a view model using an editor template that wraps the
I'm trying to implement a .NET Custom Validator that uses $.ajax to query a
I'm trying to set a page that displays the visitor's IP. All the methods
I am trying to set up a page on a wordpress site that displays
I'm trying to display the page title (html title) on the default.aspx page of
I'm trying to display a page in NSIS to obtain two different values. I

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.