Metachecker.net
|
FontsMadeEasy.com
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Page Extension
Displays a message based on the extension (like .html) of the web page. And, it is a breeze to add more file types to the script.
Insert into <HEAD>
<SCRIPT LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin URL = window.location.href; ishtm = (URL.indexOf('.htm') > -1); // true if URL contains .htm ishtml = (URL.indexOf('.html') > -1); isshtml = (URL.indexOf('.shtml') > -1); isphtml = (URL.indexOf('.phtml') > -1); // End --> </script>
Insert into <BODY>
<center> <SCRIPT LANGUAGE="JavaScript"> if (isphtml) { document.write("This is a .phtml file!"); } else if (isshtml) { document.write("This is a .shtml file!"); } else if (ishtml) { document.write("This is a .html file!"); } else if (ishtm) { document.write("This is a .htm file!"); // Include the generic .htm last because if tested // first, it would be true for all the file types above } else { // It is something else.... document.write("This file is of an unknown type."); } </script> </center>
Other Options