Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Unable to link JS with my HTML (vid)

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #184979
    Aritmos
    Participant

    READ DESCRIPTION
    http://youtu.be/Y1iZE0SwV9w

    #184985
    __
    Participant

    READ DESCRIPTION

    You can write your question here on the forum, please.

    Also, “I followed a tutorial and it didnt work” is not a question.

    Tell us:

    • what you are trying to accomplish
    • what you did, and what you expected to happen
    • what actually happened
    • any errors encountered (make sure you check for them — I didn’t see you look at the console/dev tools in your video)

    It would probably be helpful to make a reduced test case to demonstrate your problem (e.g., on codepen). It is not reasonable to expect people to watch a video of your code to try and troubleshoot it.*

    * notwithstanding, I do notice you’ve got two jquery scripts on your page (a regular version, and a minified version); this might cause conflicts.

    #184989
    Aritmos
    Participant

    just so you know i have just started programing.

    i was trying to accomplish that when i clicked the button all my “p” would hide. I have tried it with color change and many other things, but none worked. Im not sure what you mean by console/dev tools but i haven’t messed with any of that.

    The first jquery script is the jquery library and the second is the actual js file like the main.css

    Codepen: http://codepen.io/anon/pen/EHByK

    (It might be something stupid that I might not notice or just that since im running a newer version of jquery than the vid there might have been changes.)

    There is no question. Its kind of troubleshooting.

    #184991
    __
    Participant

    Im not sure what you mean by console/dev tools but i haven’t messed with any of that.

    Most major browsers include some kind of developer tools (usually by pressing [F12]). For JS, I prefer Chrome’s dev tools, but try out whichever browser you prefer.

    The first jquery script is the jquery library and the second is the actual js file like the main.css

    I couldn’t say without actually seeing what those files contain,* but they are named as if they are both jQuery.

    If I pull in jQuery only once, your script works as expected:

    http://codepen.io/adrian-enspired/pen/czJub

    * you need to use fully qualified URLs on codepen; relative URLs like “main.css”won’t work.

    edit

    Don’t worry about being “new to programming” or making “stupid” mistakes. Everyone is/was a beginner at some point; it doesn’t mean you’re dumb. Just keep putting forth the effort, and you’ll learn in due time.

    #185024
    Aritmos
    Participant

    I see what you did in the code pen. but how would you link it to ab external file like i wanted to do in the video.

    for what i know in the first .js file its what makes me able to use jquery instead of the js beast. the second is the link to the actual js file with all the code in it.

    I am away from my computer sp i cant show you the jquery library but its just an imense page of js.

    #185109
    Aritmos
    Participant

    I FOUND THE PROBLEM!

    I checked the dev tools and in under network it said under jquery-2.1.1.mim.js “Failed to load responsive data”

    i used a cdn:
    https://code.jquery.com/jquery-2.1.1.min.js

    if i put it as a url it gives me the code but for some reason the webpage can load it. Any ideas???

    #185132
    __
    Participant

    You don’t need to link to the jQuery library in Codepen…

    I know. I intentionally used a <script> tag to reflect how the OP was loading things, and to make it obvious that there is no need for two files in this case.


    @Aritmos
    , I still think those two files are duplicates. As I said above, I can’t be sure, but they use well-established naming conventions. One looks like jQuery, the other, jQuery in a minified format.

    http://code.jquery.com/jquery-2.1.1.min.js
    if i put it as a url it gives me the code but for some reason the webpage can load it. Any ideas???

    No reason it shouldn’t be able to. If you look at my codepen example, you’ll see that is the same URL I used (successfully). Can you reproduce this error?

    #185147
    Aritmos
    Participant

    sorry i meant cant load it

    i know you can do the jquery thing in codepen but i wanted to to test if it could load it since it cant on my site

    #185204
    Aritmos
    Participant

    ok so the new question is:

    how do you link an external jquery file who’s library is a url.

    if i have done that correctly then why cant my page load the url (js library)

    #185208
    Paulie_D
    Member

    Cross domain issue?

    Perhaps it’s a security setting and you need to use the https link instead.

    #185213
    Aritmos
    Participant

    I took out the ” type=”text/javascript” ” and now the page downloads it, but my external js file doesnt work. How can i fix this??? Ive tried all that i have seen in the web.

    #185214
    Aritmos
    Participant

    I FOUND IT!!!!!!!!!!!!!!!!!!!!!!

    I cant believe it after 2 weeks all i needed to do was put the actual js before the library! Now it works! Even though i found it myself you guys lead me into the right direction and were a real help overall!

    thanks

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.