473,385 Members | 1,338 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,385 software developers and data experts.

Permission denied error on getting window.location.href property

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 6946
acoder
16,027 Expert Mod 8TB
Possibly a bug. However, there's no need for document.domain here. See Same_origin_policy_for_JavaScript.
Jul 10 '09 #2

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

Similar topics

3
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 =...
2
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...
1
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 ::...
21
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. ...
2
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? ...
1
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 =...
2
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...
3
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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...

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.