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

Hi everyone. :-)

This is the first time I've had to ask for help. What better place than here?

I'm trying to write to a frame (an iFrame, actually) in a browser that didn't call the script, but cant seem to figure out how. Ideally, I'd like the decision on which frame to write to to be made by the script, not assigned by the browser. The output to that frame will be output to frames of the same name in other browsers on other machines (shotgun output).

I suspect it to be frightfully simple, but I cant seem to put my finger on it. The solution has to be cross browser and using simple http requests and delivery to provide for overzealous firewall junkies.

Help appreciated! Monks! Monks! Woo! Woo!

:-)
  • Comment on Writing To Frame That Didn't Call The Script

Replies are listed 'Best First'.
Re: Writing To Frame That Didn't Call The Script
by etcshadow (Priest) on Mar 17, 2004 at 22:45 UTC
    Your question is a little bit hazy... if you mean that you want a link to push content into a different frame, then refer to that other frame (by name) in the target of the <a href...> tage or the <form ...> tag that is pushing the request.

    If what you mean is that you've loaded a page into frame X, but want (as a result of loading that page) to alter content in a different frame, then you can do this with simple javascript (not sure how browser portable this is or isn't... try it yourself!):

    print " <script language=jscript> top.$frameName.document.innerHTML = ... </script> ";
    or however you want to manipulate the innerHTML of that document.

    Or, you can (more simply) just push a new page into that other frame:

    print " <script language=jscript> top.$frameName.document.location = '$other_page.pl'; </script> ";
    That sort of thing. Good luck.
    ------------ :Wq Not an editor command: Wq
      You understood what I need! Thanks for the ideas, I'll explore the JavaScript side of things further. I would just have preferred perl over javascript, thats all.

      Thank you very much you two (etcShadow, Happy_The-Monk). jZed? Thanks for the sarcasm (got a good laugh), but you really have to work on your people skills. lol

      see you :-)
Re: Writing To Frame That Didn't Call The Script
by Happy-the-monk (Canon) on Mar 17, 2004 at 22:29 UTC

    Small chance would be to always use target="_top", thus calling the base frameset page: Make that a programme that writes the whole frameset dynamically. Thus it would allow you to have the server site programme decide which frame to write to.

    Sören

Re: Writing To Frame That Didn't Call The Script
by jZed (Prior) on Mar 17, 2004 at 21:51 UTC
    What better place than here?

    A place that has something to do with browsers?

    I'd like the decision on which frame to write to to be made by the script, not assigned by the browser.

    I'd like world peace.

    The way to control frames is through the TARGET attribute of various HTML tags in your browser.

    update sorry for being snotty, but there really is no way to do what you're asking.