Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

frame

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

0
Comment
Question by:ethar1
[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
  • 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 1000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

636 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