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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:46:25+00:00 2026-05-23T04:46:25+00:00

Problem Scripts on some pages that use jquery are not activating. Scenario Finding that

  • 0

Problem
Scripts on some pages that use jquery are not activating.

Scenario
Finding that I couldn’t get a script to work I put a very simple test script on a page in order to test that the jquery was functioning.

<script type="text/javascript">
$(document).ready(function (){
      $(".testJavascript").addClass("hover_red");
});
</script>
<p class="testJavascript">This paragraph is to test Javascript</p>

This should add a red border but it will not function.

Troubleshooting I’ve Tried
I checked for the presence of the jquery core and it appears in the header of the page. Its enqueued and appears to be working correctly on some other pages, so I have no reason to suspect that its been corrupted.

I tried the following tests:

  • Put the above script in the header template, just before the closing header tag
  • Put the script in the body of the page right above the test paragraph to which it relates
  • Enqueued the script in case there was some sort of conflict that I wasn’t anticipating. This caused the page to stop loading – can’t see why this would cause a problem.. EDIT: After further testing I suspect this was caused by the $ vs jQuery nomenclature. Having changed it the enqueueing of this script no longer stops the page loading. however, the script still doesn’t work.
  • Finally since I’m a novice and I always suspect that I’m the cause of the problem I put the script and html snippet onto a page on my local MAMP server. It worked as expected. I think this exonerates my coding but maybe not.

I’m bemused as to what the cause of the problem might be.

I’d appreciate any suggestions as to where to look for the possible source of the problem.

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-23T04:46:26+00:00Added an answer on May 23, 2026 at 4:46 am

    Answering My Own Question

    The final solution to this problem was to enqueue the style sheet related to the test script.
    I had referenced the css file by using a standard link in the header, added in the header template above the ending header tag. It appears that this wasn’t working because when I enqueued the style file the script worked.

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

Sidebar

Related Questions

I have a bash script to upload some files to my webserver. The problem
I have a problem with a bash script. I have to use the operator
I have a script that constantly segfaults - the problem that I can't solve
A project I'm working on requires the use of jQuery on customers' Web pages.
I have found a problem with use JQuery timeout, i have a page with
I'm writing some disposable Haskell scripts to solve some of the Project Euler problems.
Ok, here's a problem script. var links = [ 'one', 'two', 'three' ]; for(
I have a small problem with a script. I want to have a default
My problem is: I have a perl script which uses lot of memory (expected
I'm having an extremely weird problem with a PHP script of mine. I'm uploading

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.