Html

From Torben's Wiki
Jump to navigationJump to search


DOCTYPE

Default:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">

Strict:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">

Frameset:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
       "http://www.w3.org/TR/html4/frameset.dtd">

Meta Tags

<meta name="author" content="NAME">
<meta name="keywords" content="Keyword1, Keyword2">
<meta name="description" content="Text">
<meta name="date" content="2008-12-01T14:20:37+02:00">
<meta http-equiv="content-language" content="de">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">

Disable browsercaching

<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">

Disable proxy-server caching

<meta http-equiv="pragma" content="no-cache">

Forwarding

direct Forward to another page

<html>
<head>
<meta http-equiv="refresh" content="0; url=/joomla">
</head>
<body></body>
</html>

Open a page inside frame

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>FRAME TITLE</title> 
<frameset rows="*" cols="*" frameborder="0" framespacing="0" border="0">
<frame src="/joomla/index.php" name="Joomla">
</frameset>
</html>

iFrame - Page in Page

<iframe src="http://www.entorb.net"></iframe>
<iframe src="http://www.entorb.net" width="100%" height="300"></iframe>

Disable Right-Click

http://www.web-wise-wizard.com/javascript-tutorials/disable-right-click.html

<SCRIPT LANGUAGE="JavaScript"> 
var message="";
function clickIE() {
 if (document.all){ (message);return false; }
}
function clickNS(e) {
 if (document.layers||(document.getElementById&&!document.all)) {
  if (e.which==2||e.which==3) {(message);return false;}
 }
}
if (document.layers) {
 document.captureEvents(Event.MOUSEDOWN);document.  onmousedown=clickNS;
}
else {
 document.onmouseup=clickNS;document.oncontextmenu  =clickIE;
}
document.oncontextmenu=new Function("return false")
</script>

Alternating table row colors

<body>
<style type="text/css">
tr.d0 th { background-color: #CC9999; color: black; }
tr.d0 td { background-color: #CC9999; color: black; }
tr.d1 td { background-color: #9999CC; color: black; }
</style>
...

print "";

JavaScript table filtering

From [1]

<head>
   <link rel="stylesheet" href="de-districts-results.css" />
   <script>
       function mySortFunction() {
           // Declare variables
           var input, filter, table, tr, td, i, txtValue;
           input = document.getElementById("myInput");
           filter = input.value.toUpperCase();
           table = document.getElementById("myTable");
           tr = table.getElementsByTagName("tr");

           // Loop through all table rows, and hide those who don't match the search query
           for (i = 0; i < tr.length; i++) {
               td = tr[i].getElementsByTagName("td")[0];
               if (td) {
                   txtValue = td.textContent || td.innerText;
                   if (txtValue.toUpperCase().indexOf(filter) > -1) {
                       tr[i].style.display = "";
                   } else {
                       tr[i].style.display = "none";
                   }
               }
           }
       }
   </script>
</head>


<body>
<input type="text" id="myInput" onkeyup="mySortFunction()" placeholder="Landkreissuche">
LandkreisBundeslandEinwohnerFälleTodeFälle pro 1 Millionen EinwohnerTote pro 1 Millionen EinwohnerPrognose Fälle Morgen (%)
Flensburg (Kreisfreie Stadt)Schleswig-Holstein89504250279.00.04.8
Kiel (Kreisfreie Stadt)Schleswig-Holstein2475481461590.04.046.9
</body>
</html>