Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


Web pages (more)




Multiple files model




Using other formats




HTML plus images (browse-and-move-on)

HTML plus images is the most portable format, readable on anything. Your users are not just on PCs but on mobiles, tablets, netbooks, and on old machines and old software. Why make them unable to read your work unless there is a good reason.

pdf, docx, doc, ppt, xls, ps, rtf (and in general anything that requires plug-ins and separate applications) may break the clean Web model of browse-and-move-on.



HTML creates a seamless Web - Other file types can break this

  1. Searching for and searching in:
    If it is in HTML, the content can be easily picked up in search engines (whereas content of other formats may be less accessible).
    Content on a page can also be easily searched in HTML.

    
    
  2. Linking in and out:
    If it is in HTML, people can link to it, can link to sub-sections within it, and those sections in turn can link back out to the Web.




How to browse your Web pages

  


Dev site and production site

Bad to edit directly in public_html. Why?

Good to have a dev site (development, save drafts, test) and a production site (live to the world).
When dev site changes are debugged, copy changes to production site.




Ways of linking: relative links and absolute links

To be able to browse the site in different ways like above, we need to use relative links:

rather than absolute links:

so that the link will work whether we are browsing in "http mode" or "file mode"

  

Example of ways of linking


In page:

 https://student.computing.dcu.ie/~mhumphrysdculab/s/s/file.html 

To include this image:

 https://student.computing.dcu.ie/~mhumphrysdculab/img.jpg


Choices:

1. Absolute http address
 <img src="https://student.computing.dcu.ie/~mhumphrysdculab/img.jpg"> 

2. Absolute http address, dropping server
 <img src="/~mhumphrysdculab/img.jpg"> 

3. Absolute file address
 <img src="/users/tutors/mhumphrysdculab/public_html/img.jpg"> 

4. Relative address
 <img src="../../img.jpg"> 


Notes:

2. works for http:// mode only
3. works for file:// mode only

1. works for both http:// and file:// mode
 but only works for production site, not dev site (if different)

4. works for both http:// and file:// mode
 and works for both dev site and production site 




How to upload your Web pages

Say your website is on UNIX server:

  1. Edit them directly off public_html in UNIX.

  2. Edit them in other dir in UNIX. When ready, copy them into public_html.

  3. Edit them in Windows. Upload to UNIX.

  4. Edit UNIX files directly from Windows:



Exercise - Offline web pages

Web pages can be off the Internet. You can still browse them with the browser.
Example: The works of Shakespeare. On the shared DCU Linux file system, but not on the Internet.
  1. Make an offline web page file.html in your home directory (not in your public_html):
    cd
    gedit file.html &
    
  2. View it in the browser through: file:///users/GROUP/USER/file.html
  3. You cannot view it through: http://

  4. Insert an <img src ... tag in it that embeds an image.
  5. The image will be an image on the local disk, not on the web.
  6. The image will be the image of Shakespeare found in my directory.
  7. Figure out how to view my Shakespeare files through the browser. Find the location of the image of Shakespeare.
  8. Embed using the path to my image, not a copy.

  

ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.