Начало
Детали страницы
Страница Расширение
Отображает сообщения на основе расширения (например, HTML.) веб-страницы.
JavaScript Page Details: Страница Расширение
<!-- TWO STEPS TO INSTALL PAGE EXTENSION: 1. Copy the coding into the HEAD of your HTML document 2. Add the last code into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <SCRIPT LANGUAGE="JavaScript"> <! > <! > <!-- 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> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your HTML document --> <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> <!-- Script Size: 1.29 KB -->