hit125 application concepts Types of links File paths & directory structures
hit125 application concepts Types of Links Other web pages Your web pages Within a page Links within same X/HTML document URL for another Web server Same site: Identifies other web pages stored on the same webserver – need file name & path
hit125 application concepts Absolute addresses Absolute links An absolute link defines the location of the document absolutely including: the protocol to use to get the document, the server to get it from, the directory (folder) it is located in, and the name of the document itself. eg-
hit125 application concepts Pathways Absolute pathnames href=”/home/users/html/frost.html” Web Server home users html frost.html href=”/D|html/poetry/frost.htm” Web Server D| html poetry frost.htm href=”/Hard Disk 2/HTML Poetry/frost.html” Web Server Hard Disk 2 HTML poetry frost.html
hit125 application concepts Absolute links Issues Linking from external sources – out of control of web developer – external site could be down or address changes Link rot - error 404 – file not found Domain name or IP address eg hill.com/ IP code harder to maintain Less meaningful to user and coder Difficult to update IP easily
hit125 application concepts Relative links Relative pathways (preferred) –Indicates where the resource is in relation to the current page home A relative link takes advantage of the fact that the server knows where the current document is. –to link to another document in the same directory, we don't need to write out the full URL. –we only need to use is the name of the file Allows sites to become transportable with the least amount of Web designer effort
hit125 application concepts arachnids index.html spiders.html Spiders scorpions.html Home Spiders Directory (folder) File Key: Spiders wwwroot All Web files go here
hit125 application concepts Link pathways Relative pathnames href=”poetry/poem.html” Web Server poetry poem.html href=”lit/poetry/poem.htm” Web Server lit poetry poem.html href=”../poem.htm” Web Server poem.html href=”../../poetry/poem.html” Web Server poetry poem.html
hit125 application concepts
Naming files