[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting back Page Source View rather than actual page display.
hi Ed,
HTTPAPI is just a tool for sending bytes over a network using the HTTP
protocol. It's not a web browser, and doesn't understand how to
interpret JavaScript (or HTML or XML or JPEG or GIF or PNG, etc etc etc)
It's true that a web browser does send/receive stuff with the HTTP
protocol. But that amounts to perhaps 1% of the code in a browser.
Whereas, it's the only thing HTTPAPI does :(
It would be really neat if HTTPAPI were a full-fledged browser that
could be controlled by RPG, though... I wish I had the resources to do
something like that.
Ed Schechter wrote:
> Here's what I'm trying to solve.
> Google Maps exports some functionality only through Javascript. I'm
> trying to invoke a page from HTTPAPI, execute some JavaScript, and
> retrieve page after JavaScript draws its results onto the page.
> ----------------------------------------------------------------------
> ------------
> Here's a test php -- JSTest.php
> <html>
> <head>
> <script>
> function wumboize() {
> document.getElementById('result').innerHTML =
> 'wumbo' ;
> }
> </script>
> </head>
> <body onload="wumboize()">
> <?= date("H:i:s") ?>
> <div id='result'>fish</div>
> </body>
> </html>
> Here's what I see when I invoke localhost/JSTest.php in a browser
> 15:09:16
> wumbo
> Here's a snippet from an RPG program calling the page
> c eval url = 'http://10.10.2.92/' +
>
> c 'ajaxBackend/' +
>
> c 'JSTest.php'
>
> c eval file = '/tmp/testJSget.txt'
>
> c eval rc = http_url_get(url:file)
> c callp cmd('DSPF ''/tmp/testJSget.txt''': 200)
>
>
>
> Here's what the RPG program displays
> <html>
> <head>
> <script>
> function wumboize() {
> document.getElementById('result').innerHTML = 'wumbo' ;
> }
> </script>
> </head>
>
> <body onload="wumboize()">
> 15:25:18 <div id='result'>fish</div>
> </body>
> </html>
> This is the same text as 'View Page Source' shows from the
> browser.
>
> ----------------------------------------------------------------------
> -------------------
> Any suggestions on how to return the Javascript output
> ('wumbo') would be much appreciated.
> Ed Schechter
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------