Solved

CGI script returning a HTML document to a given frame

Posted on 1997-05-25
1
188 Views
Last Modified: 2013-12-25
How to have a CGI script return a HTML document to a given frame ?

I defined a frameset with two frames frameA and frameB.
I defined a form formX in frameB.
Should the user submit formX, I want the CGI script to return a HTML document
which modifies frameA and not frameB.

It's easy with a simple hyperlink:

<A TARGET="frameA" HREF="http://www.something.com">

But this doesn't work with javascript:

<A TARGET="frameA" HREF="javascript:'window.top.frameB.document.formX.submit ()'">

How to proceed ?
0
Comment
Question by:stormtrooper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
Trevor013097 earned 100 total points
ID: 1828097
Are you using a CGI script or Javascript.  A CGI would be done server side using something like Perl and Javascript is client side.

From what you have posted you don't need the TARGET when using Javascript as the targeting is done by Javascript itself.  You should place what it is you want to do into a function and then call the function.

For Example

<SCRIPT LANGUAGE="Javascript">

function returnPage() {
  parent.frameB.location="page-name.html"
}

</SCRIPT>

Place the above in the <HEAD> secton of your page.

Then in your body use the following for a hypertext link:-

<A HREF="javascript:returnPage();">Return Page</A>

or to have the function called when your form is submitted use the following in the opening <FORM> tag:-


<FORM NAME="name_of_form" ACTION="your-action" onSubmit="returnPage()">

Hope this helps,

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question