in reply to Re: onClick
in thread onClick

Hello again!

There is some server-side javascript code in html file I've dumpped from some web page
by using LWP::UserAgent, HTTP::Request and HTTP::Response... The problem is that I must
click on a button to initiate executing query (there is no link I could parse and call it)
directly... so there is probablly only one chance to use Javascript module (wrappers
around libjs) before I dig in libjs sources and try to find out how does mozilla
communicate with http servers...

Thx, anyway.

Replies are listed 'Best First'.
Re: Re: Re: onClick
by screamingeagle (Curate) on Feb 27, 2002 at 00:20 UTC
    the javascript you get by retrieving the code of a file using LWP::UserAgent is client-side javascript,not server-side.
    i should point out that , contrary to what ignatz said about Microsoft products using server-side Javascript, that s not quite correct. Server-side javascript can be used only with Netscape-specific application servers. ASP and IIS use server-side VBScript and Jscript , not Javascript.JScript is Microsoft's version of Javascript,however it does not work with Netscape browsers.
Re: Re: Re: onClick
by ignatz (Vicar) on Feb 26, 2002 at 22:56 UTC
    JavaScript code in a web page that you can see by viewing its source isn't server-side JavaScript. While it does reside on the server, it is passed to the client and executes on the client. Very few web servers use server-side JavaScript (M$ web servers though ASP and Netscape being the two that come to mind) and if they were you wouldn't be able to see the code in action by viewing the source of the web page only by viewing the code that generated the HTML that you are viewing.
    ()-()
     \"/
      `
      Maybe this page can be a good example..

      http://www.atomica.com/solutions_products_web.html

      So is there any chance to get results without runnig
      web browser....?

        I've followed that link, and it reduces to the first interpretation of my list. The JavaScript simply submits the form request and pops it up in a new window. This is easily simulated with LWP, you just have to get the parameters just as the JavaScript code sets them up. Consider setting up a local proxy server through which you connect with your browser - that way you will see all communication between your browser and the server, and you can replay that communication using LWP.

        I still wonder why you do want to automate querying a FAQ - simply directing users to that page would help them as well.

        perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web