Prevent a javascript/php function to execute on load page -
i got php code redirect page inside 1 php function:
<script> function a(){ <?php header('location: http://www.localhost.com/'); ?> } </script> i know if there way stop redirect inmediatly when load page, , if possible javascript or jquery, cause tried js , couldn't find way .
the php end of process before javascript does. i'm not sure why have set way need come different way of doing things. perhaps not using php @ best option here , using javascript command change page instead.
such as:
<script> function a(){ window.location = "http://www.localhost.com/"; } </script> <button onclick="a()">go</button>
Comments
Post a Comment