codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  refresh parent after closing pop up window  mhcallahan at 20:00 on Wednesday, February 08, 2006
 

I'm trying to refresh a parent window after opening a window using window.open. Not having any success.

I've tried using

window.parent.refresh()
window.parent.reload()

before using

window.close()

I'm calling the function from an onclick eventhanlder associated to a form button.

Looks something like this.

function whoAmI

if statement is met

call window.open(url) function
window pops up

User then completes two form fields to set two cookies

User selects the submit button an fires off onclick evenhandler - referenced above.

that is when I need to refresh the parent window - not having any luck

Please help
Thanks mhc



  Re: refresh parent after closing pop up window  asha at 10:29 on Tuesday, March 21, 2006
 

try refreshing the main window after popup close
window.close(..)
parent.refresh()

  Re: refresh parent after closing pop up window  dhanalakshmi at 10:08 on Friday, December 15, 2006
 

Use this to close the child window and then refresh the parent window. This works for me.


window.close();
if (window.opener && !window.opener.closed) {
window.opener.location.reload();
}

  Re: refresh parent after closing pop up window  rajendrarana at 08:47 on Thursday, June 28, 2007
 

Hi Dhanlakshmi , i have used your above given code , and i got solution from it.

Thanks lot.



  Re: refresh parent after closing pop up window  PhaniReddy at 07:54 on Tuesday, July 29, 2008
 

how to know the status of parent window from being on the child window..wheather parent window closed or not..

  Re: refresh parent after closing pop up window  arach1983 at 10:30 on Wednesday, February 18, 2009
 

I have used your code but it works only after i refresh the page once,
after refreshing one time.. the JS works fine...
help ?!! :(

  Re: refresh parent after closing pop up window  partha at 11:30 on Friday, February 20, 2009
 

You can read the below link. Which will help you a lot.
http://shawpnendu.blogspot.com/2009/02/automaticaly-refresh-parent-window.html

Regards
partha

  Re: refresh parent after closing pop up window  jessonerik at 06:13 on Wednesday, October 14, 2009
 



Ok, the tests are online, just tell me what I am doing wrong with the selector I am using... debt management I should tweak the original demo to make things to apparently work... ;-)

I cannot make "table#test td" work in your match, but that does not work in DomQuery either so I believe there is still some bug there. I should change the selector to just "td" to see all the cells highlighted. I changed the order of parameters in your match code to fit my needs in these tests, (element, selector).

In cssQuery/jQuery it takes too long but time does not matter here, and the reason they take to long is because they first collect all the nodes matching the selectors, which is not needed in our implementation. So move the mouse slowly on the "X"...

However I bet both Dean and John can extract a faster Match(element, selector) from their current project. My only purpose with these test was to show that this is doable and work as expected in all frameworks bad credit loan .

Your sample code is good enough to also convince me that this can be done with selectors, and letting the most complicated options out I hope will give us acceptable speeds in most situations.

To give you a hint about why something is wrong with match, you will see that in my code I am doing also ancestors, I mean if an ancestor match we will also need to return true. Hope it helps.

This is not a benchmark...I may have failed to write the selectors, and I may have failed in using the wrong methods in these libraries.


What I notice, and didn't think of before, in your example with my match function is there is no use of the CSS selector cascade and specificity. This is noticeable where the first set of "x" elements are supposed to have a yellow background but have a blue background mortgage loan .

The API could be made to look even more like CSS

NW.Event.appendDelegate('table#test td', {
mouseover: function() {this.style.backgroundColor="yellow";},
mouseout: function() {this.style.backgroundColor="";}
});

The "one shot" remove delegate is not working in the example because the important line is commented. (If I click the buttons multiple times I see multiple alerts.) Even if it was working and if my brief look gave me an idea of what you are trying to achieve, I don't like the idea of being able to make a particular element exempt from a behavior if it still matches the selector. I think it would be better to make the element no longer match the selector in some way. If the CSS specificity and cascade is used then a new class name could be added to the element and a later "appendDelegate" statement could override the "one-shot" behavior current mortgage rates .

  Error Deleting File or Folder  stevanturk at 11:28 on Tuesday, October 20, 2009
 

Just read at www.pathtoolong.com

  Re: refresh parent after closing pop up window  pratik.itworld at 05:13 on Tuesday, November 17, 2009
 

just add this script n call the function on the specific event u want to close ur pop up window and refresh the parent window automatically.

<script language="JavaScript">
<!--
function refreshParent() {
window.opener.location.href = window.opener.location.href;

if (window.opener.progressWindow)

{
window.opener.progressWindow.close()
}
window.close();
}
//-->
</script>








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
• C++
• Re: refresh parent after closing pop up window
• Dynamic Insertion
• Date and Time function around the world???
• Significant Factors
• Perl array access
• Re: huffman encoding and decoding in C++...
• Perl One Liner: Replace {(
• Re: html including php, accessing the functions


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009