Page Details JavaScript Code Snippets

These snippets all deal with Page Detail JavaScripts. There are several snippets that do make a site more pleasant to visit. You can write the time a visitor entered the page, how long they’ve been there, write when the page was last updated, whether it was updated since you last visited, and lots more.

Results via Envato Market

Save page space by opening a new window to display larger images on your site when a thumbnail image or a picture text link is clicked. The same window is re-used when the images are the same size. Cool!

This is a neat little script that makes your web page look a whole lot more ‘professional’. This JavaScript will display a small box with the time the visitor loaded the page.

The e-mail address is stored on the server in a disassembled form which is later re-assembled by your browser using Javascript. Spambots merely perform simple text searches for valid e-mail addresses and they will not be able to harvest any e-mail addresses from your webpage. For example: “aol.com” is stored in one place, “joe8625” in another, and “@” in yet another. Then, there is a paragraph of programming code that tells your internet browser to assemble the three parts into a clickable link.

Create popup windows that will center on your screen or popup near your link without popping off the edge of the screen. Also shows how to create a clickable popup or a popup that displays when you hover over the link with your mouse. Cool!

Use this script in your onload events to kick-start your Web pages with the right relative font size. It checks the screen resolution (not the browser size) and sets the base ’em’ size accordingly.

Allow the visitor to set your site as their homepage with a link. This script works best in Internet Explorer, but also displays the appropriate information based on browser type.

If you would like to have several sites sharing one ‘contact us’ page, you can! Each site can link to the same page (but each with a unique string) and the appropriate site’s information will be highlighted #fafafa in the contact table. For example, If they clicked on the ‘contact us’ link on the real estate page, the table cell with the real estate contact email address will be highlighted #fafafa instead of white on the contact us page. Clever!

IE 5.5+ allows you to change the colors of scroll bars in a textarea tag or the browser window. Select the colors you want for the respective scroll bar attributes and see how they will look. Then, switch the “Show Source” to “Yes”, re-submit, and the code will appear in a new window. Pretty neat!

This script helps you write the copyright statements on your page. It outputs the correct Roman Numerals for any year you want, including the current year. Clever!