javascript - Why am I not able to use this script in dreamweaver -


i'm not able use code in php.. i'm using dreamweaver

{ <script language = "javascript">  var counter = 0;  // call update function in 2 seconds after first load id = window . settimeout("update();", 2000);  function update() {     counter++;     window.status = "the counter @ " + counter;     document.form1.input1.value = "the counter @ " + counter;      // set timeout next count        id = window . settimeout("update();", 2000); }  </script> } 

you not outputting script: page needs have html content in execute javascript (by browser). echo script , go there.

<?php { echo'<script language = "javascript">  var counter = 0;  // call update function in 2 seconds after first load id = window . settimeout("update();", 2000);  function update() {     counter++;     window.status = "the counter @ " + counter;     document.form1.input1.value = "the counter @ " + counter;      // set timeout next count        id = window . settimeout("update();", 2000); }  </script>'; } ?> 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -