hac13 hac13 - 1 year ago 110
CSS Question

How are webpages linked?

I'm having trouble figuring out how two pages are linked. For example if I have the following code:

<!DOCTYPE html>
<button onclick='myfunction()'>Click me</button>

function myfunction() {
//some code to take user to the next page

some style code

How is the code for the second html file called?

Do all the contents of all webpages reside in one big html file where elements are hidden depending on the what they've clicked on? For example - the
's shown on the 'home page' would be shown, while other ones hidden, if you click on a 'home' tab; essentially reformatting the elements on a page for a given file.

Answer Source

1) They're typically on different .html documents, and are usually loaded with <a href="http://location">Link text</a>.
2) You can load a page via javascript by doing document.location = "http://location" as well.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download