Ask your own question, for FREE!
Computer Science 12 Online
OpenStudy (e.mccormick):

@chosenmatt href link example

OpenStudy (e.mccormick):

OK, let me do three really small files to show this: index.html: ``` <html> <head> <title>About me!</title> </head> <body> <p>Take a look at <A HREF="resume.html">my resume</A>.</p> <p>Read about <A HREF="hobby.html">my hobbies</A>.</p> </body> </html> ``` resume.html: ``` <html> <head> <title>My Resume</title> </head> <body> <p><A HREF="index.html">Click to get back to the index.</A></p> <p>Resume</p> <p>Bla bla</p> <p>Lots about me</p> </body> </html> ``` hobby.html: ``` <html> <head> <title>My hobbies</title> </head> <body> <p><A HREF="index.html">Click to get back to the index.</A></p> <p>Hobby List</p> <p>Bla bla</p> <p>Lots about my hobbies</p> </body> </html> ``` Now, you typically would use some sort of template file to include your navigation and other common parts. However, that is the very basics of how multiple pages can use HREF links to move between them.

OpenStudy (e.mccormick):

If you use a script to load the content, it is something similar, but using whatever commands the script uses. This is just the basics of how links work.

OpenStudy (chosenmatt):

okay i have a question....if i have a css stylesheet or app.js for page hobby.html for example how do i upload it to that exact page? @e.mccormick

OpenStudy (e.mccormick):

A style sheet would be loaded in the head content. You just load it on each page. You can do similar include things to load any needed scripts.

OpenStudy (e.mccormick):

Look at the external style sheet here: http://www.w3schools.com/css/css_howto.asp Something like that can be used so that you have one css file and inlude it on all the pages.

OpenStudy (chosenmatt):

@e.mccormick so i put my style sheet like this <link rel="stylesheet" type="text/css" href="mystyle.css"> that goes in the head section of index.html

OpenStudy (e.mccormick):

In the head of each file you want to use that style sheet in.

OpenStudy (chosenmatt):

okay what about app.js?

OpenStudy (e.mccormick):

I have not done much with JavaScript so I do not know the best way to load it accross multiple pages. Too bad @dumbsearch2 is not on more. He really knows this stuff.

OpenStudy (e.mccormick):

Ah, here we are: http://www.w3schools.com/js/js_whereto.asp ``` <!DOCTYPE html> <html> <body> <script src="myScript.js"></script> </body> </html> ``` That is their example on external javascript, so one js file can be made and loaded in more than one HTML document.

OpenStudy (e.mccormick):

Now, w3schools is NOT perfect. They have some mistakes. But I would say 85% to 90% is decent info.

OpenStudy (chosenmatt):

@e.mccormick u are only suppose to use one .js in one website? wow i didnt know that....

OpenStudy (e.mccormick):

No, you can use more than one script. It is just an easier way to load a script in multiple pages. Let me take MathJax as an example. Lets say you had a site on math. You have several pages that need math formatting and some that do not. On the ones that need math formatting, load the MathJax script to run the formatting. On the ones that don't you do not bother to link that script in. Rahter than retype the entire MathJax script every time, you just use the script link to load it.

OpenStudy (anonymous):

thats cool

OpenStudy (bohotness):

WICKED XDDDDDDDDDDDD

OpenStudy (chosenmatt):

yep :D finally learned how 2 do this

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!