Linking HTML with iQuery


#1

Can you explain me the meaning of the statement which links HTML with jQuery. What does it mean, what does it say to the browser?

<script type='text/javascript' src='script.js'></script>

#2

It says to the browser there's a jquery file, you need to load

type - tells the browser what type of file it is
src - is the source of the code (so the url)


#3

You: Hey browser, could you fetch me the 'script.js' file so I could use it, that would be great. Thanks.
Browser: Sure but what kind of file is it. How are you going to use it?
You: It's a text/javascript file of course, dumb browser.
Browser: K. Here's your file, which will now be run.

FYI: The 'dumb browser' part represents that you could've easily removed the type attribute, because "text/javascript" is the default.