473,782 Members | 2,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Permission denied error on getting window.location .href property

3 New Member
Permission denied exception is fired in IE6 on line(9) during the following
actions .

Expand|Select|Wrap|Line Numbers
  1. (1)<html>
  2. (2)<head>
  3. (3)    <title>Simple :: documentDomain :: Cars</title>
  4. (4)</head>
  5. (5)<body>
  6. (6)    <script>
  7. (7)        var fake = window.location;
  8. (8)        document.domain = "localhost";
  9. (9)        var href = window.location.href;
  10. (10)    </script>
  11. (11)</body>
  12. (12)</html>
Note:
Page is accessed on localhost.

a. If line (7) or (8) is omitted, no exception occurs.
b. If page is hosted on production with document domain name equal to
something.com, all works well.
c. In IE7 all is working fine.

Is it IE6 bug?
Is it possible to prevent exception for accessing all window.location .href properties after document.domain was set?
Jul 10 '09 #1
1 7016
acoder
16,027 Recognized Expert Moderator MVP
Possibly a bug. However, there's no need for document.domain here. See Same_origin_pol icy_for_JavaScr ipt.
Jul 10 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
41419
by: Robert Mark Bram | last post by:
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.location.href; If it happens to find a window named 'someWindowName' that currently has a
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
21
18178
by: alistair_henderson | last post by:
Morning All, I have some code for a website which uses 'window.open' to simulate modal dialog boxes. I use the window.closed property to decide if the window object exists at various points. This has been fine until last week when I started getting javascript 'Permission Denied' errors when I try to access this property. I suspect that a windows update has caused this somehow, as this code has not changed for a very long time. Can...
2
4549
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;
1
5637
by: prash.marne | last post by:
Hi, I am trying open a simple popup window & my code is .. <html> <head> <title>popup_window</title> <script type="text/javascript"> function popup_onclick(){ my_window = window.open("",'windowname','width=400,height=200');
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)
3
5012
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...
0
9480
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
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
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
10080
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
9944
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
6735
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
5378
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3643
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.