Vicki Brown wrote:

> For my current contract we have a CGI on server A that users can log into
> directly.  It controls their experience.
> 
> We have a second CGI on server B, behind the firewall. In case anyone is
> familiar with it, CGI B is a forum/discussion app called "Web Crossing".
> 
> I have been asked (if I can) to set things up so that CGI A controls CGI B
> remotely.  The user will think they are interacting with CGI/server A at all
> times.
> 
> I am using libWWW to pass requests back and forth, using LWP::UserAgent.
> Everything works spiffily ... except if CGI B wants to do something with
> Javascript ...


JavaScript is by default run in the browser.  Since LWP::UserAgent is
emulating the browser, it would have to understand JavaScript to do
anything meaningful with the JavaScript it receives from any CGI.

For JavaScript that is just set up to invoke a server side URL (your
first example) you may get away with what you need:  Recognize the
onClick action, and have LWP::UserAgent invoke the URL.  If what you're
seeing in LWP as a response is different than what you see as a browser,
there are several considerations to think about:

(1) What you're "seeing" in the GUI browser may be the result of JavaScript
     being run there on page receipt.  You need to look first at HTTP level
     data and see if your responses are identical.

(2) The server may be serving a different result to LWP because it knows
     enough to think it doesn't support JavaScript (maybe something silly
     like looking at a user agent header, etc.).

(3) The browser may be carrying cookies around that you're not carrying around
     in your LWP application.

(4) The browser may be carrying around hidden fields that you're not in
     recognizing and setting in your LWP application.

Outside of Javascript, the bulk of my problems fall into the #3 and #4 areas.

A good place to start is comparing HTTP headers going back and forth in each
case.

If there's JavaScript that goes much beyond invoking server side URLs, then
you're out of luck unless you incorporate some sort of JS interpreter into
LWP.  The calendar sounds like it may fall into that category.  But now you're
way past my experience level ...  There's probably a JS angle here I missed.
Most of my Perl/JS experience involves adding JS to pages created with CGI.

-- 
Steve Sapovits
Global Sports Interactive
http://www.globalsports.com
Work Email:  [EMAIL PROTECTED]
Home Email:  [EMAIL PROTECTED]
Work Phone:  610-491-7087
Cell Phone:  610-574-7706

Reply via email to