473,791 Members | 3,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Permission denied to get property Location.href

Hi All!

I have a piece of JavaScript that attempts to find the location.href
property of another window. For example:

contentWindow =
window.open('', 'someWindowName ');
var otherUrl = contentWindow.l ocation.href;

If it happens to find a window named 'someWindowName ' that currently has a
document loaded from some other host, the "contentWindow. location.href" code
triggers the following error:
Error: uncaught exception: Permission denied to get property
Location.href

I know I could put this code inside a try-catch. However, while I found this
works on IIS5.1 (my testing server), I also found that the version of
Chilisoft I have to use on the production server does not support
try-catch...

So my question is this: how can I avoid the uncaught exception in this case
without using a try-catch?

Thanks for any advice!

Rob
:)
Jul 20 '05 #1
3 41420
Rob,

Your quoted code looks like client-side script, so I'm puzzled as to what
possible effect your hosting server ASP environment might have. Use of
try/catch on the *client* is dependent only on the browser and the js
version it supports....

Tim


"Robert Mark Bram" <re********@rem ovethis.optusho me.com.au> wrote in message
news:3f******** **************@ news.optusnet.c om.au...
Hi All!

I have a piece of JavaScript that attempts to find the location.href
property of another window. For example:

contentWindow =
window.open('', 'someWindowName ');
var otherUrl = contentWindow.l ocation.href;

If it happens to find a window named 'someWindowName ' that currently has a
document loaded from some other host, the "contentWindow. location.href" code triggers the following error:
Error: uncaught exception: Permission denied to get property
Location.href

I know I could put this code inside a try-catch. However, while I found this works on IIS5.1 (my testing server), I also found that the version of
Chilisoft I have to use on the production server does not support
try-catch...

So my question is this: how can I avoid the uncaught exception in this case without using a try-catch?

Thanks for any advice!

Rob
:)

Jul 20 '05 #2
Howdy Tim!
Your quoted code looks like client-side script, so I'm puzzled as to what
possible effect your hosting server ASP environment might have. Use of
try/catch on the *client* is dependent only on the browser and the js
version it supports....


Of course you are right - I was thinking about the error message without
thinking about it coming from client side. Ignoring the try-catch issue, the
problem is the same: how can I avoid this error:
Error: uncaught exception: Permission denied to get property

Rob
:)
Jul 20 '05 #3


Robert Mark Bram wrote:
I have a piece of JavaScript that attempts to find the location.href
property of another window. For example:

contentWindow =
window.open('', 'someWindowName ');
var otherUrl = contentWindow.l ocation.href;

If it happens to find a window named 'someWindowName ' that currently has a
document loaded from some other host, the "contentWindow. location.href" code
triggers the following error:
Error: uncaught exception: Permission denied to get property
Location.href


Well, you can't change that, as you yourself write the document in the
other window is loaded from some other host, and the same origin policy
prevents script from one host to access properties of pages from another
host. If the hosts are in the same domain e.g.
host1.domain.tl d
and
host2.domain.tl d
then you can set
document.domain = 'domain.tld'
and the cross frame scripting should work, but if the hosts are in
different domains then there is nothing you can do, unless it is
Mozilla/Netscape where you could work with signed script.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #4

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

Similar topics

1
6072
by: Klunk | last post by:
Hi, last week I moved the folder of my Intranet application to another disk of the same server. After this change all the ASP page return this error: Microsoft VBScript runtime error '800a0046' Permission denied: 'CreateObject'
2
14958
by: John Mack | last post by:
Intermittently I get the following error on Firefox: "Error: uncaught exception: Permission denied to get property HTMLDocument.window" What can cause this error? I do an image switch via JS just before redirecting the page (also via JS), could this be the problem - not giving enough time to do the image switch before redirecting? Pieces of the page I created that generated this error are below. The
1
7177
by: Jake Barnes | last post by:
I can not figure out the meaning of this error: Error: " nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame :: http://www.bluecasts.com/pdsIncludes/pdsAjax.js :: submitAnyForm :: line 635" data: no] Source File: http://www.bluecasts.com/pdsIncludes/pdsAjax.js Line: 635
2
4550
by: laredotornado | last post by:
Hi, I'm trying to use the xmlHttpReq object to contact a URL on my server. But I'm getting a JS "Permission denied" error at the indicated line. What does it mean and how can I get around it? function signUp(signUpElt) { if (!ValidEmail(signUpElt.value)) { alert("Please enter a valid email address."); return;
2
1873
by: prays | last post by:
Hi, I have made a script that should check if users on my site are registering to example a newsletter or a contest. But now when i want to check the location in the window, it says permission denied. Can any one help me? Here's the code: <script type="text/JavaScript" language="JavaScript"> a = null; url = "http://www,mycash.dk/registred.php"; function vispopup(adresse)
4
3461
by: MrGado | last post by:
Running on Windows XP with Mozilla 2.0.0.4, I am experiencing a strange security issue. function loadXMLDoc(url,funcname) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) { alert("Permission UniversalBrowserRead denied.");
3
5013
by: doby48 | last post by:
I have a JavaScrip that runs fine under all browsers except IE. I am opening up a document within an iframe and I get the error of Permission Denied in IE. I know that IE has security that will throw that error if the pages are on a different domain but in this case they are all on the same domain. The pages are in a subdirectory but I am referencing them accordingly and not calling a different domain. My code is as follows: <SCRIPT...
1
7018
by: Mihania | last post by:
Permission denied exception is fired in IE6 on line(9) during the following actions . (1)<html> (2)<head> (3) <title>Simple :: documentDomain :: Cars</title> (4)</head> (5)<body> (6) <script> (7) var fake = window.location;
0
9517
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
10207
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
10156
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
9030
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
7537
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
6776
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
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.