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 = "http...pl?field=" + 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


In reply to Re: Re: How to make a friendly UI by Anonymous Monk
in thread How to make a friendly UI by daveh71

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.