Access denied javascript error

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;
 
B

bruce barker

script can not access the dom from another site (cross script). if they
are the same site, check if one is a server name and the other an ipaddress.

-- bruce (sqlwork.com)
 
J

Jeremy

But why is the script trying to access the dom from another site. The
application in the IFrame should only be accessing it's own dom, and I never
wrote any code to do otherwise.

bruce barker said:
script can not access the dom from another site (cross script). if they
are the same site, check if one is a server name and the other an
ipaddress.

-- bruce (sqlwork.com)
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;
 
C

Chapuis Nicoolas

Hi, I know this post has a long time.
But I thing I find the answer.
I had the same problem.
And when you look your script code, is correct but...
that is the difficult, thing about xsl code.
When you have the xsl:include balise in your xsl code.
Internet Explorer say "refuse".
good bey.
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;
On Monday, July 30, 2007 3:53 PM bruce barker wrote:
script can not access the dom from another site (cross script). if they
are the same site, check if one is a server name and the other an ipaddress.

-- bruce (sqlwork.com)

Jeremy wrote:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top