Howcome I cannot make my javascript 'executable' in an address bar
- by imHavoc
The second link does not work like the first one. How come?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Dynamic CSS Properties</title>
<script language="JavaScript">
function change(){
//document.getElementById("box1").style.visibility = "visible";
var spanArray = document.getElementsByTagName('span');
var number_spans = spanArray.length ;
for( var i = 0; i < number_spans ; i++ ){
var target = spanArray[ i ] ;
// do something with target like set visibility
target.style.visibility = "visible";
}
}
function change2(){
var spanArray=document.getElementsByTagName('span');var number_spans=spanArray.length;for(var i=0;i<number_spans;i++){var target=spanArray[i];target.style.visibility="visible";}
}
</script>
</head>
<body>
<a href="javascript:change2();">Change</a>
<br />
<a href="javascript:var spanArray=document.getElementsByTagName('span');va r number_spans=spanArray.length;for(var i=0;i<number_spans;i++){var target=spanArray[i];target.style.visibility='visible';};
">Show Spans</a>
<br />
<div style="position: relative; overflow: hidden;"><center>
<br><br>
<font size="5" color="blue">
1. just press the <img src="http://up203.siz.co.il/up1/jw2k4az1imny.jpg"> button on the top to see the picture i promise you its so funny!!!!:
<br><br><br>
<span style="background: none repeat scroll 0% 0% white;"><span style="visibility: hidden;">
<a onmousedown="UntrustedLink.bootstrap($(this), "77a0d", event)" rel="nofollow" target="_blank" onclick="(new Image()).src = '/ajax/ct.php?app_id=4949752878&action_type=3&post_form_id=3917211492ade40ee468fbe283b54b3b&position=16&' + Math.random();return true;" href="http://thebigbrotherisrael.blogspot.com/2010/04/all-family-guy-characters-in-real-life.html">Press here to see the picture!!!</a>
</span><span style="visibility: visible;"></span></span></font></center></div>
</body>
</html>