Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Re: How to make a friendly UI

by Anonymous Monk
on May 06, 2001 at 10:07 UTC ( #78332=note: print w/replies, xml ) Need Help??

in reply to Re: How to make a friendly UI
in thread How to make a friendly UI

Yes, all this is very much correct. I have had the dubious pleasure of doing a fair amount of this sort of thing via the hidden frame. A couple of important points to be on the look-out for:
  1. If you are expecting this to function as a "function" call, (i.e. returning a value, and/or halting execution of the calling process (javascript) untill returning) you are pretty much SOL. The loading of the cgi script in the hidden frame can be thought of as occuring in a different 'thread' if you will. In order to wait untill the return of the perl function (i.e., wait for the completion of the execution of the cgi, and download/render in your browser) you'd have to go into some horrible hokey javascript which gets vaguley reminiscent of programming in old-school basic with goto-line-numbers and the like... ugh, at the thought.
  2. in the javascript provided above, (which I understand is off-the-cuff... I merely point this out so that others avoid the potential pitfalls)
    <- document.location.href = newurl; -> parent.**hiddenJSframesNameHere**.document.location.href = newurl;
    or else you'll be reloading your own frame which is exactly what you wanted to avoid! and please, PLEASE use the javascript function escape(...) when constructing that get-string... like:
    var newurl = "" + escape(field) + "&value=" + escape(v +alue);
    (escape performs URI-escaping... for similar stuff in perl, look at URI::Escape)

--a (hopefuly) helpful perl web-junky

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://78332]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2023-09-30 21:48 GMT
Find Nodes?
    Voting Booth?

    No recent polls found