![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Videochat Solutions
Industry Role:
Join Date: Aug 2004
Location: Canada
Posts: 49,062
|
Scripting question for brainiacs
Is there a way to refresh a parent page from a pop-up?
For example, Imagine you have a page with a link that says "click here to sign up". When clicked a pop-up opens requesting the usual info. Once completed, the user can close that window and cause the previous or parent window to automatically refresh. Suggestions?
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
|
The only thing I can think of is to do it using http push or comet.
- Source page that spawns popup has jquery requesting blah.php every second waiting for a value of "true" - Source page loads popup - Popup shows whatever, onUnload it runs a script to set blah.php to true - Source page get's it's true signal and does whatever Can be made more "live" using http push but that's the idea basically here.
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: May 2012
Posts: 124
|
I think you can do this with native javascript and the window object and using window.opener to control the window which triggered the popup
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
(>^_^)b
Industry Role:
Join Date: Dec 2011
Posts: 7,223
|
Parent page:
Code:
<script type="text/javascript"> function OpenPopup() { window.open('ChildPopupWindows.aspx', '', 'width=200,height=100'); }; </script> <input type="button" value="Open popup" onclick="javascript: return OpenPopup()" /> Code:
<script type="text/javascript"> function CloseWindow() { window.close(); window.opener.location.reload(); } </script> <asp:Button ID="btnServer" runat="server" OnClick="btnServer_Click" Text="Request server" /> <br /> <input type="button" value="Close Window" onclick="javascript: return CloseWindow();" /> Code:
protected void btnServer_Click(object sender, EventArgs e) { } Or something like this in the child page using window.opener: Code:
<script> window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); } </script>
__________________
![]() I've referred over $1.7mil in spending this past year, you should join in. ![]() ![]() I make a lot more money in the medical field in a lab now, fuck you guys. Don't ask me to come back, but do join Chaturbate in my sig, it still makes bank without me touching shit for years.. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |