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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:42:43+00:00 2026-06-05T08:42:43+00:00

For some reason the external .js file I am linking to isn’t working. I

  • 0

For some reason the external .js file I am linking to isn’t working. I am linking to it like so:

<script src="jquery.js" type="text/javascript"></script>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>

I have tested jquery using a simple inline script to hide a paragraph of text when it is clicked on so the jquery library is present and working.

The jquery.js file is in the same folder as the index.php file that is calling it.

What am I doing wrong?

This is the code I have in the external .js file currently just to test it is working(it isn’t):

$("document").ready(function(){

    $("p").click(function(){
        $("p").css("color", "red");

    });


});
  • 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-05T08:42:44+00:00Added an answer on June 5, 2026 at 8:42 am

    Problem 1

    It looks like jquery.js contains the code you wrote that depends on jQuery.

    You need to load jQuery before you try to use it.

    Swap the order of the <script> elements.


    Problem 2

    $("document") will wait for <document> elements to be ready. HTML doesn’t have such a thing. Lose the quotes to pass in the document object directly.

    Better yet, forget about the explicit call to ready and just

    jQuery(function () { /* your function */ });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some jQuery code in an external Javascript file that is making an
For some reason it looks like constructor delegation doesn't work in the following snippet:
I'm attempting to select all <script type=text/html> tags in a page. I use <script>
I am looking for a way to make sure an external script file won't
I've deployed an ear file on Jboss 7.1 that uses some external modules. I've
I have this javascript code (the function SHA-1 is located in an external file):
I have some c++ classes that I'd like to compile into a dll file.
I am developing a web application. For some reasons, I need to use external
For some reason I'm really struggling with this. I'm new to wpf and I
For some reason, I was under the impression that it was just called Timeout,

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.