Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Running JavaScript in perl by proxy

by BaldPenguin (Friar)
on May 08, 2007 at 16:55 UTC ( #614193=perlquestion: print w/replies, xml ) Need Help??

BaldPenguin has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks:

I have a device where JavaScript support is spotty and AJAX support is nil, and yet I want to consume some web services where the only access is through AJAX. My initial thought is to build a proxy in perl on the server side to do the consuming, and then parse the data in a re-write to the client browser using either XSL to transform one page into the other or maybe even using the raw JSON object. Getting modules or code to post and read web pages is WELL documented. What I need is a way to run JavaScript inside the perl code.

Has anyone seen this yet? Is there a JavaScript VM accessible from inside perl?

Any help or advice is appreciated.

Don
Everything I've learned in life can be summed up in a small perl script!

Replies are listed 'Best First'.
Re: Running JavaScript in perl by proxy
by Joost (Canon) on May 08, 2007 at 17:57 UTC
      From what I have been told and seen to date, Mechanize and it's derivatives do not process the JavaScript within the page. Is that assessment incorrect?

      It may be possible to find the script nodes and process them with JavaScript, but that would get a little hairy when it came to the src includes inside a page.

      Don
      Everything I've learned in life can be summed up in a small perl script!
Re: Running JavaScript in perl by proxy
by gloryhack (Deacon) on May 08, 2007 at 17:07 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://614193]
Approved by kyle
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-08-17 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?