Forums

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

Home Forums JavaScript Where does the HTML link to the JS file?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #172919
    AsteroidMonkey
    Participant

    Hi,

    I have a decent bit of experience with basic HTML/CSS websites but am trying to learn more about js.

    I was looking at this page on codepen and couldn’t figure out where in the HTML, the js is called in.

    Can anyone help?

    Cheers,
    Marc

    #172926
    Paulie_D
    Member

    It might not be.

    In Codepen, if you write the raw JS in the JS box it just runs automatically when required or immediately, if it’s supposed to run on page load.

    #172997
    shaneisme
    Participant

    If you inspect the DOM of the iframe, you can see where the JS is in the page if that’s what you’re wondering.

    #173001
    Alen
    Participant

    @AsteroidMonkey

    If you need information on how to link example.js file in your HTML. Take a look at html5boilerplate index page. If you are confused about anything in that file, let us know.

    I was looking…on codepen and couldn’t figure out where in the HTML, the js is called in.

    CodePen is a sophisticated system that lets you type in code and preview it live. What you enter in those 3 boxes is essentially taken into the system and injected into the preview. If you inspect the preview you’ll see styles and scripts. In the example pen you linked to, all the code is actually in the JS box. Nothing extra is linked up. You can see this by clicking on the little gear circle for settings. Each box has it’s own (HTML, CSS, JS). Now the code is just minified version of modernizr.com, which is a feature detection tool. Non of the animations are actually running from this JS file.

    I’ve forked a version without JS here. If you look at the settings again, you’ll see Modernizr checked off, and that’s it. All animation is CSS.

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