J
Jeremy
I'm getting an access denied error from a line of Javascript which I think
comes from some of the ajax plumbing. I debug it in visual studio and the
code is in the ScriptResource.axd file of my application. I've included the
code below, and the access denied error is happening when trying to access
to the top.document.documentElement object. I only get this when my
application is appearing in an IFrame. I also using IE7.
switch(Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
Sys.UI.DomElement.getLocation = function
Sys$UI$DomElement$getLocation(element) {
/// <param name="element" domElement="true"></param>
/// <returns type="Sys.UI.Point"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
if (element.self || element.nodeType === 9) return
new Sys.UI.Point(0,0);
var clientRects =
element.getClientRects();
if (!clientRects || !clientRects.length) {
return new Sys.UI.Point(0,0);
}
var w = element.ownerDocument.parentWindow;
var offsetL = w.screenLeft -
top.screenLeft - top.document.documentElement.scrollLeft + 2;
comes from some of the ajax plumbing. I debug it in visual studio and the
code is in the ScriptResource.axd file of my application. I've included the
code below, and the access denied error is happening when trying to access
to the top.document.documentElement object. I only get this when my
application is appearing in an IFrame. I also using IE7.
switch(Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
Sys.UI.DomElement.getLocation = function
Sys$UI$DomElement$getLocation(element) {
/// <param name="element" domElement="true"></param>
/// <returns type="Sys.UI.Point"></returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
if (element.self || element.nodeType === 9) return
new Sys.UI.Point(0,0);
var clientRects =
element.getClientRects();
if (!clientRects || !clientRects.length) {
return new Sys.UI.Point(0,0);
}
var w = element.ownerDocument.parentWindow;
var offsetL = w.screenLeft -
top.screenLeft - top.document.documentElement.scrollLeft + 2;