Solved

CGI script returning a HTML document to a given frame

Posted on 1997-05-25
1
179 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
1 Comment
 
LVL 5

Accepted Solution

by:
Trevor013097 earned 100 total points
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now