+ 1

I didn't use jquery cdn on my website...I served it locally but it isn't working on my website. I need help.

6th Dec 2019, 6:21 PM
Bobby
Bobby - avatar
11 odpowiedzi
+ 5
Bobby Are you saying that when referencing the jQuery script from CDN, your local hosted website runs as expected and when you change the reference to a local copy of jQuery (and nothing else), things no longer work as expected? If this is the case, here are a few more questions to help fill in the missing details. 1. Are you loading your web page using a local web server or directly from the files system. In other words, does your browser URL begin with the http or file protocols? 2. Have your confirmed whether or not your local reference is loading by reviewing the network requests in your built in browser development tools? 3. What errors are you seeing? Be very specific with where the errors appear and use the exact text. 4. Where is your jQuery file stored relative to your HTML file? What path are you using for your local reference to the jQuery file? 5. Which version of jQuery are you serving from your local server? Which CDN version were you using when things were working?
8th Dec 2019, 11:16 PM
David Carroll
David Carroll - avatar
+ 5
Bobby You can upload it to an activity post. Also, if you can, copy the content from your HTML file to a web code in SoloLearn. Don't worry about getting it to work on SoloLearn. It won't because you won't have your local assets. I just want to review anything else that might jump out.
30th Dec 2019, 2:26 AM
David Carroll
David Carroll - avatar
+ 5
David Carroll I'll make sure to post updates as I always do, he didn't dm tho, probably gone for few other days.. And yes, hosting your files online and getting a domain name is a fundamental thing when you're a web developper, people should learn to search online, because that's how all of us learn things!
30th Dec 2019, 7:54 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 3
More detail would help but I'll give some troubleshooting tips. jQuery should work without a CDN as long as you're copying the correct content and have a script element referencing it. Check that your intended jquery library is downloading properly. - You can also check by hitting the absolute URL that your script src attribute refers to. - Use your browser's developer tools. The network tab should show an HTTP request corresponding with your script src for downloading the jquery library. The "response" tab should show all the content of the file. Is $ not recognized? Check if 'jQuery' is recognized instead of $. If yes, you may want some extra JavaScript to say something like: $ = jQuery; so you can reuse $ as a reference to the jQuery library.
8th Dec 2019, 10:12 PM
Josh Greig
Josh Greig - avatar
+ 3
Bobby Regarding the error messages, it would help if you could provide a copy of the exact error message. That should give us the clues on where to direct you next.
30th Dec 2019, 2:02 AM
David Carroll
David Carroll - avatar
+ 3
Bobby you can host your files for free using github pages. There are many tutorials online, but if you still can't figure it out feel free to dm me.
30th Dec 2019, 5:08 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
Aymane Boukrouh Indeed... Another fundamental skill is learning to find the information in the form of online references and credible articles or answers to existing questions. That will come with time as well, I suppose. 😉
30th Dec 2019, 8:00 AM
David Carroll
David Carroll - avatar
+ 1
Aymane Boukrouh If you guys do get it resolved via DM, please post an update here with a summary of the issues. Thanks for jumping in to provide guidance. While hosting locally is about as basic as you can get with setup, there are some fundamentals people need to know to get it figured out. 😉
30th Dec 2019, 7:43 AM
David Carroll
David Carroll - avatar
0
David Carroll according to your questions 1. I'm loading my web page directly from the files system...I don't know how to use a local web server and I appreciate if I can learn from you. 2. I've tried but I don't think things are going well. 3. I don't understand most of the error messages. 4. It's in a different folder from my html file. 5.the file I used is jquery3-4-1.js Thanks for your help. I'm grateful.
30th Dec 2019, 1:49 AM
Bobby
Bobby - avatar
0
Josh Greig please how do I read the HTTP requests corresponding with my scrip sec... How do I check whether $ is recognized..I need more of your explanation. Thanks for help. I appreciate.
30th Dec 2019, 1:53 AM
Bobby
Bobby - avatar
0
David Carroll That is a problem now...I took photos of the code on my laptop with my phone but now I can't send pictures via sololearn. https://t.me/xe_bobby ... is my telegram link I'll send you the pictures once you chat me up
30th Dec 2019, 2:19 AM
Bobby
Bobby - avatar