473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.location.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 2910
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.location.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.location.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
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...
16
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....
2
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...
4
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....
1
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...
3
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...
7
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 =...
9
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"...
1
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"> ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.