Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] calling js function from php


  • From: joel.goldstick at columbuswebmakers.com (joel.goldstick@xxxxxxxxxxxxxxxxxxxxx)
  • Subject: [Javascript] calling js function from php
  • Date: Mon May 29 11:37:27 2006


suresh kumar wrote:
> i am facing  some problems in my project.
>    
>   1) i want to call a javascript function from php. this is my code.

First, understand that your php code runs when the reader requests the 
webpage.  It runs on the host site -- before the reader receives the 
page.  What the reader sees is the resulting html and javascript.

The javascript runs in the browser.  You can run javascript code which 
then requests a new page from the host.  In your example, you might want 
to request a new page with the URL : yourpage.php?con=1 or 
yourpage.php?con=0


>   <script type="text/javascript">
>    function confirmask()
> {         
>          
>        var con=confirm("you are trying to cancel a mirrored display location.Do u want to continue");
>        if(con==true){
>          window.location("yourpage.php?con=1");  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>        }
>        else if(con==false){
>          window.location("yourpage.php?con=0");>  <<<<<<<<<<<<<<<<<<<<<<<<<<<
>        }
>       
>   }
>   </script>

-- 
Joel Goldstick
www.columbuswebmakers.com