function call
Posted: Thu Sep 30, 2010 11:09 am
This is not working:
Why it shows an alert box when the page is loaded is strange. It seems like it enters the function without a function call. Have tested with onclick, action and href. They all do the same. Any idea what's wrong here?
thanx!
Code: Select all
<script>
function write_href() {
</script>
<?php
//If cars >10
if (cars>10) {
?>
<script> window.open("bilar.php",'_self'); </script>
<?php } else {?>
<script>alert("var god invänta svar!");</script>
<?php } //end else?>
<script> } //end function </script>
<a oNclick="javascript:write_href();"><b>inkommande svar</b></a>thanx!