renegade44 Posted October 1, 2009 Share Posted October 1, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/176132-need-help-on-how-linking-to-an-extenal-jquery-file-works/ Share on other sites More sharing options...
trq Posted October 1, 2009 Share Posted October 1, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/176132-need-help-on-how-linking-to-an-extenal-jquery-file-works/#findComment-928185 Share on other sites More sharing options...
renegade44 Posted October 2, 2009 Author Share Posted October 2, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/176132-need-help-on-how-linking-to-an-extenal-jquery-file-works/#findComment-929304 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.