Jump to content

Recommended Posts

Im not confused with how to link to an external file. My confusion lies in how this works with Jquery.

 

I downloaded Jquery frameworl and have the file. now, when I want to add jquery to my page, do I need to link the downloaded file, and the file where I did my jquery coding?

 

Do I code right in the jquery file itself?

 

do I link to the jquery file in the javascript file itself then link to that on my website?

 

Im just confused as I know i need the library but I dont know how to code externally. i can only code inline on my website, i want to put it all in an external file but I dont want it to not understand what im doing because it doesnt interact with the actual Jquery framework.

 

 

let me know if theres a way I can be more clear. hopefully i can get this cleared up lol.

 

 

 

 

 

 

 

 

 

 

Its quite a simple concept. You need to source the jQuery framework before you can use it.

 

You can then either source another file which contains your script or write your scripts within the current file. eg;

 

<html>
  <head>
      <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" src="yourscripts.js"></script>
    <script type="text/javascript">
        // script within current page.
    </script>
  </head>
  <body>
  </body>
</html>

 

Ps: It is beneficial to let Google host jQuery for you and simply include it from there.

thanks for your help!

 

My issue was I wasnt looking at the imported javascript files as if they were just in the document. I had a hard time overcoming that lol. I will use the google one in the future as well, thanks for the heads up.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.