Solved

frame

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

0
Comment
Question by:ethar1
  • 3
  • 3
6 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 11887990
Hi

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.

Regards,
Zyloch
0
 

Author Comment

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

http://xx.com/x.asp?param1=t


I want to get param1 from frame window.
Thanks
0
 
LVL 36

Accepted Solution

by:
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.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:ethar1
ID: 11888174
Thanks very much
0
 

Author Comment

by:ethar1
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?
Thanks.
0
 
LVL 36

Expert Comment

by:Zyloch
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:

self.location=self.location.href+param;

Then grab it out of the URL with ASP.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

706 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

19 Experts available now in Live!

Get 1:1 Help Now