473,732 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with opener.location .assign

Hello all,

We have a micro site that is getting opened inside a popup window from
some external main site (the domains of our microsite and main site are
different) ...

I need to support the following functionality: After the user is done
surfing the pages on our site and user clicks the close hyperlink
(present on top of all of our webpages), the opener window's location
needs to be reset to some given URL ....

I had a small javascript code for this, where i have written:
window.opener.l ocation.assign( "<url>"); .

My problem is that this line of code is throwing an exception saying
"Permission denied to access method location.assign " ...

Can anybody help me and let me know why am I getting this exception?
and how to overcome this problem?

Thank you,
Venkatesh

Oct 11 '06 #1
2 2926
Venkatesh wrote:
We have a micro site that is getting opened inside a popup window from
some external main site (the domains of our microsite and main site are
different) ...
<snip>
I had a small javascript code for this, where i have written:
window.opener.l ocation.assign( "<url>"); .

My problem is that this line of code is throwing an exception saying
"Permission denied to access method location.assign " ...

Can anybody help me and let me know why am I getting this exception?
Cross domain security. You may not access the vast majority of the
browser's object model from a script originating in a different domain.
That includes the reading of the - loaction.assign - property implied
in the attempt to call it.
and how to overcome this problem?
Generally you can access the - opener.location - property (but not its
contents) so you could try writing the URL directly to that property
(indeed that is the normal cross-browser method of navigating a browser
window, and messing about with - assign - methods should never have
even been proposed to you). I.E:-

opener.location = '<URL>';

Richard.

Oct 11 '06 #2
Hello Richard,

Thanks for your suggestion ...

opener.location = url works for me ...

Actually I was of the impression that if we directly URL to
opener.location , that would clear browser history ... But seems like
that is not the case.

I'm now wondering what is the exact use of the assign function?

Thank you,
Venkatesh

Richard Cornford wrote:
Venkatesh wrote:
We have a micro site that is getting opened inside a popup window from
some external main site (the domains of our microsite and main site are
different) ...
<snip>
I had a small javascript code for this, where i have written:
window.opener.l ocation.assign( "<url>"); .

My problem is that this line of code is throwing an exception saying
"Permission denied to access method location.assign " ...

Can anybody help me and let me know why am I getting this exception?

Cross domain security. You may not access the vast majority of the
browser's object model from a script originating in a different domain.
That includes the reading of the - loaction.assign - property implied
in the attempt to call it.
and how to overcome this problem?

Generally you can access the - opener.location - property (but not its
contents) so you could try writing the URL directly to that property
(indeed that is the normal cross-browser method of navigating a browser
window, and messing about with - assign - methods should never have
even been proposed to you). I.E:-

opener.location = '<URL>';

Richard.
Oct 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
6606
by: Diana Coppenbarger | last post by:
Hi, I have a calendar program that is popped up by a HTML so that the user can choose a specific date to be filled in via javascript from the calendar program. I am using window.open() to start the calendar program and then calling my own function "javascript:opener.setDate()" to set the date back on the main window. This all works fine if I use the current month that is displayed, but as soon as I have to rebuild the calendar because...
16
34563
by: Robert Mark Bram | last post by:
Hi All! Is there a way to reference a window by name without doing something like this: open (, 'windowName'); The open method will open a blank window if there is no window with such a name. I am trying to organise a navigation structure between two windows with content from the same host.. I have been trying the following:
2
5099
by: Snolly | last post by:
Hi all, Here is my issue. I have a web page (lets call it page1) with an iframe in it that then opens a pop-up window (page2). The pop-up window is used to edit some data that was loaded into page1 so I want to use onunload to reload page1 to keep the data synchronized. At first I was using just window.opener.parent.location = window.opener.parent.location;
4
2031
by: JPL Verhey | last post by:
Hi, I have a little test script in a pop up window. The pop up page refreshes every 2 seconds. I want it to check with every refresh if a certain page (log3.htm) is loaded in the opener window. If that is the case, another page (log4.htm) must be loaded in the opener window. In pop up page: <script>
1
2168
by: JF | last post by:
Hi, I need to change the location of the parent window and after that scroll a little bit (because of "position:fixed" css buttons, which obscure the title). I have window.opener.location.href = "newhreflabel"; window.opener.scrollBy(0, -25);
3
10730
by: alison | last post by:
I am trying to redirect the parent page when the user clicks an html button in an aspx page by using the javascript: window.opener.location.href="EditOrders.aspx"; This works fine on IE for windows or Firefox, however on IE for Mac or Safari on Mac, it doesn't work. If I enable script errors on IE for Mac, I get: 'window.opener.location' is not an object. Any ideas on how to get this to work on Mac browsers? Thanks!
7
6088
by: Alan Little | last post by:
I have a popup which contains a frame set; one of the frames contains a form. When the form is submitted, I want it to go back to the opener of the popup. I have: document.forms.target = parent.opener; But on submit it opens a new window. If I put: document.write(parent.opener.name);
9
2593
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed images are done on separate html pages that do nothing but display the
1
8453
by: Vexander | last post by:
Hi I am trying to right a script that closes a popup and then refreshes the pener to specific URL If have this that works form me <script type="text/javascript"> window.opener.location.href = 'http://localhost/fmsuite/Sales/Document.asp? docNumber=' + <%=Request.QueryString("docNumber")%>; window.opener.focus(); self.close() </script>
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.