Posted on 2004-08-24
Last Modified: 2010-04-09
Dear all,
How get passed Parameter to parent window from inside frame?

Question by:ethar1
  • 3
  • 3
LVL 36

Expert Comment

ID: 11887990

Can you elaborate a little? Are you passing a variable that is inside the frame to the parent? Or do you want a variable that was set in the parent window? If the latter, you can use parent.variableName.


Author Comment

ID: 11888071
I want a variable that was "SENT" to the parent window

I want to get param1 from frame window.
LVL 36

Accepted Solution

Zyloch earned 250 total points
ID: 11888148
Sure. Do this:

var paramName = "param1";

var param = parent.location.href.split("?")[1].split("&");
for (var i=0;i<param.length;i++) {
   if (param[i].indexOf(paramName)!=-1) {
      param = param[i].split("=")[1];

Now, if the param was sent, variable param should equal whatever is after param1. (Of course, you might have to change paramName.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.


Author Comment

ID: 11888174
Thanks very much

Author Comment

ID: 11888185
This is answer my question perfectly, but I have one more question,
the value now stored in javascript , how can pass it to asp code?
LVL 36

Expert Comment

ID: 11888261
You have to refresh the page and attach it to the end of your URL in the frame. That's the only way, then you can pick it out with ASP. For instance:


Then grab it out of the URL with ASP.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

838 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