Howcome I cannot make my javascript 'executable' in an address bar

Posted by imHavoc on Stack Overflow See other posts from Stack Overflow or by imHavoc
Published on 2010-04-28T20:51:04Z Indexed on 2010/04/28 20:57 UTC
Read the original article Hit count: 290

Filed under:
|

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), &quot;77a0d&quot;, event)" rel="nofollow" target="_blank" onclick="(new Image()).src = '/ajax/ct.php?app_id=4949752878&amp;action_type=3&amp;post_form_id=3917211492ade40ee468fbe283b54b3b&amp;position=16&amp;' + 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>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about url