Hi..
I have aspx page, and this page contain iframe. In the Iframe i try to open aspx page that contain ajax controls like animation, progress bar... the problem that i have is: when i try to move my cursor on the image that open the animation box, i get the following error: Access is denied.
When the progress bar is starting to work i get the same error..so, in each control that i am using i get this error..and i don't know how to solve this..
thank you...
The "Access Denied" error in any browser usually means that a script in one window or frame is trying to access another window or frame whose document's domain is different from the document containing the script. What can seem odd about this is that you get this error in IE for Windows frequently when a script in one window generates a new window (withwindow.open()
), and content for that other window is dynamically created from the same script doing the opening. Thefocus()
method also triggers the error.
The error can also occur if scripts try to access objects, properties, or methods that have been locked down by Microsoft's security platoon. For instance, thedocument.styleSheets.rules
property used to be accessible in IE 5 and IE 5.5, but is not in IE 6.
For the new window problem, there is a bit of history associated with the problem and workarounds. For example, the problem occurs frequently when the scripts are being run from the local hard disk. You get a clue about the situation in the titlebar of the new window: It forces anabout:blank
URL to the new window, which is a protocol:domain that differs from wherever your main window's script comes from. If, however, you put the same main window document on a server, and access it via http:, the problem goes away.
There is a workaround for the local-only problem: In the first parameter of thewindow.open()
method call, load a real document (even if it is a content-free HTML document) into the sub-window before usingdocument.write()
to generate content for the subwindow. The loading action 'legitimizes' the window as coming from the same domain as your main window's document.
(This solution does not affect scripts that load a page from a secure server into a separate window or frame. Anhttp:
protocol in one window andhttps:
in the other--even if from the same server.domain--yield a security mismatch and "Access Denied." Setting thedocument.domain
properties of both pages may solve the problem (but I am unable to test it for sure).)
For other situations (such as thedocument.styleSheets.cssRules
problem, there are no workarounds, so you'll have to find another way around your task.
One more source of this error in IE occurs if you assign a too-long search string to a URL or a form (using the GET method) has lots of elements and data. The HTTP GET method has a built-in limit of approximately 512 characters. If you run into the problem, change the method to POST, which has no data length limit. But POST won't reflect the search string in the URL of the replacement page (in case you're expecting to parse that data as a way to convey data from one page to the next).
No comments:
Post a Comment