Re: Curl on a javascript button?

From: Date: Mon, 07 Aug 2006 15:20:17 +0000
Subject: Re: Curl on a javascript button?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24850@lists.php.net to get a copy of this message
On 8/7/06, LFaR <livefreeandroam@gmail.com> wrote:
Hi, Given a form of this type: <form id="form_id" name="form_name"> <input type="button" value="Click Here" OnClick="new_window(' http://hostname/site?arg1=val1&arg2=val2');" /> </form> Where new_window() is a simple Javascript function that pops up a new window with the given url. Is it possible to automate the OnClick event? I'm wondering if I can programmatically cause the 'OnClick' event to occur. One solution is for me to use curl to extract the URL from the 'new_window()' function and execute it directly. Though, I am left wondering if there are alternatives I have not yet discovered.
Runing JS on a button would require an HTML parser and a JS interpreter. AFAIK there are none for PHP. There definately is one for Java (I've used it with HttpUnit). The easiest solution is just to pull out the URL and run it yourself. -- Justin Patrin

« previous php.pear.general (#24850) next »