JS on demand (ou comme si)
Je ne sais pas trop quoi mettre comme exemple alors je mets une page;
http://javatwist.imingo.net/desac.htm
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>...</title>
</head>
<body>
<p>
<a id="desac" href="?yes">Je veux activer javascript.</a>
</p>
<script type="text/javascript">
if(location.search){
var censure=document.createElement("script");
censure.setAttribute("src","fonctions.js");
document.getElementById("desac").href="desac.htm";
document.getElementById("desac").firstChild.data="Javascript est activé.";
document.getElementsByTagName("body")[0].appendChild(censure);
}
</script>
</body>
</html> |