Javascript Window.opener.location.reload Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more location href permission denied about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Permission Denied To Access Property Href
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping permission denied to access property reload iframe each other. Join them; it only takes a minute: Sign up Opener.Location.Reload(); displayed Permission denied error in java script up vote 4 down vote favorite 1 I had two domains for ex. domain1 and domain2, I am opening domain2/index.aspx page as popup from domain1/default.aspx page. While closing domain2 page i need to reload the domain1 page, i had given the javascript code as "Opener.Location.Reload();". I am getting Permission denied javascript error. Any ideas about this issue. javascript permissions denied share|improve this question edited Dec 4 '08 at 12:06 johnstok 28.7k113976 asked Dec 4 '08 at 12:01 Marugs 2 as a minor nit-picky thing, that should be opener.location.reload(); (all lower case) –scunliffe Dec 4 '08 at 13:18 add a comment| 3 Answers 3 active oldest votes up vote 6 down vote I found that setting a parentUrl variable in the popup window (gotten from a query string) and then using : window.opener.location.href = parentUrl; works. I don't know why, I think it's magic, but it works (tested on IE, chrome and Firefox). You cannot read the value of window.opener.location.href, but you can set it to whatever url you want. I use this oddity to do the refresh. Hope it helps share|improve this answer answered Apr 6 '10 at 15:55 lau 32228 add a comment| up vote 2 down vote Certain properties and actions are specifically blocked in cross-domain scenarios. What you might be able to do is create a function on the parent that does the code you want, then call that function from the child. Example: // On the parent... function DoTheRefresh() { location.reload(); } Then, on the child: opener.DoTheRefresh(); I have done this in the past, so I don't know for sure if it's still an option. I hope it works out for you :) share|improve this answer answered Dec 4 '08 at 12:21 Timothy Khouri 18.5k1562110 add a comment| up vote 2 down vote You can accomplish this by putting code in the parent window to detect when the child window has closed. var win2; function openWindow() { win2 = window.open('http://...','ch
Community Forums >Programming >JavaScript Development window.opener.location.reload() error Discuss window.opener.location.reload() error in the JavaScript Development forum on Dev Articles. window.opener.location.reload() error JavaScript Development forum discussing the use of JavaScript and its features as a powerful DOM manipulator. JavaScript is used in most websites to enrich the interface and enhance the user experience. Add This Thread To: Del.icio.us Digg Google Spurl http://stackoverflow.com/questions/340354/opener-location-reload-displayed-permission-denied-error-in-java-script Blink Furl Simpy Y! MyWeb « Previous Thread | Next Thread » Thread Tools Search this Thread Display Modes Dev Articles Community Forums Sponsor: #1 July 22nd, 2004, 04:22 AM Comms Registered User Join Date: Jul 2004 http://forums.devarticles.com/javascript-development-22/window-opener-location-reload-error-9228.html Posts: 2 Time spent in forums: < 1 sec Reputation Power: 0 window.opener.location.reload() error hi, i've been trying to get a pop up to refresh the window it came from (opener) and then close when it's finished. I thought i had got it from looking around google, but everytime i try this script i get this error Line: 7 Char: 3 Error: 'window.opener.location' is null or not an object here are my pages. parent.html PHP Code:
<html>
<head>
<title>title>
<basename="mainwindow">
<scriptlanguage="javascript">
functionreloadIt(){
window.opener.locationASP.NET Community Standup Forums Help Home/ASP.NET Forums/General ASP.NET/HTML, CSS https://forums.asp.net/t/1198828.aspx?Refreshing+the+Parent+window+after+closing+Child+window+with+javascript and JavaScript/Refreshing the Parent window after closing Child window with javascri... Refreshing the Parent window after closing Child window with javascript RSS http://www.codingforums.com/javascript-programming/1766-reloading-window-opener-get-permission-denied-error.html 10 replies Last post Jan 03, 2008 10:15 AM by pixelsyndicate ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts permission denied Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Reply Swati Jain Member 340 Points 748 Posts Refreshing the Parent window after closing Child window with javascript Dec 28, 2007 08:13 AM|Swati Jain|LINK In Parent Window, Child window opens as follows newwin permission denied to =window.open("CallReport.aspx","newwin","toolbar=no,directories=no,status=yes,menubar=yes,left=0,top=0,width=800,height=525,scrollbars=yes,resizable=yes") I have written the code as follows in child window to refresh the parent window after childwindow closes (code is written in child window as follows) I got the JScript Runtime error .Permission Denied. How this can be resolved? Reply NC01 All-Star 40650 Points 15353 Posts Re: Refreshing the Parent window after closing Child window with javascript Dec 28, 2007 08:38 AM|NC01|LINK Try this instead: window.opener.__doPostBack('ChildWindowPostBack', ''); Just make sure that this is included in the parent page Page_Load event handler: GetPostBackEventReference(this, string.Empty); NC... Reply interwandere... Member 675 Points 533 Posts Re: Refreshing the Parent window after closing Child window with javascript Dec 28, 2007 08:41 AM|interwanderer1|LINK this post may help http://foru
New? Today's Posts FAQ Rules Guidelines Search Advanced Search Forum :: Client side development JavaScript programming reloading window.opener get permission denied error If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Enjoy an ad free experience by logging in. Not a member yet? Register. Results 1 to 5 of 5 Thread: reloading window.opener get permission denied error Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible 07-11-2002,12:33 AM #1 rocket View Profile View Forum Posts New to the CF scene Join Date Jul 2002 Posts 2 Thanks 0 Thanked 0 Times in 0 Posts reloading window.opener get permission denied error I searched around the site and have tried some suggestions, but have no success. after some processing I am doing the folowing from the child window script window.opener.location.reload(); window.close(); This works for one of my pages, but for another page it displays the js error dialog with Error: permission denied. same error on IE 5.5 and 6.0 the url I am trying to reload is http://www.some.com/index.html?dd=fi..._it&type=blank it works in Netscape any help would be greatly appreciated Last edited by rocket; 07-11-2002 at 12:35 AM. Reply With Quote 07-11-2002,02:09 AM #2 glenngv View Profile View Forum Posts Supreme Master coder! Join Date Jun 2002 Location Philippines Posts 11,075 Thanks 0 Thanked 256 Times in 252 Posts are the 2 pages on the same domain? if it's not, then it might be one of the restrictions on cross-domain security. Glenn vBulletin Mods That Rock! Reply With Quote 07-11-2002,02:32 AM #3 rocket View Profile View Forum Posts New to the CF scene Join Date Jul 2002 Posts 2 Thanks 0 Thanked 0 Times in 0 Posts yes they are both in the same domain. i open the child window with newWin=window.open("url","windowname","h=300,w=300") nothing really special Reply With Quote 07-11-2002,02:41 AM #4 glenngv V