Click to See Complete Forum and Search --> : JS Error: Access Denied...


Dr_DK
04-11-2003, 02:12 PM
Hello all,

If anyone could help on this one, it would be much appreciated.

I've spend a lot of time trying to figure this out. So I finally decided to ask you experts for help!

This is my problem:

On my domain I'm using Frame Redirect!
On my page I have this piece of code, which generates and Error on the status bar on IE, stating Access Denied!

Here's the code that I have on that page:

<script language="JavaScript">
<!--
document.write("<img src=\"http://mypath/log.cgi?ref="+top.document.referrer+"\" width=1 height=1 border=0>");
//-->
</script>
<noscript>
<img src="http://mypath/log.cgi?ref=noscript" width=1 height=1 border=0>
</noscript>

Now I think what's causing the error is the "top.document.referrer"!!! How do I change the code, or add something to it so that it doesn't cause the error???
Thanks for any help!

khalidali63
04-11-2003, 02:19 PM
Typically access denied error is gnerated when you are trying to access any info about a webpage that resides on some other domain then yours,Its a built in browser security feature and JavaScript can not manipulate it.

Cheers

Khalid

Dr_DK
04-11-2003, 02:51 PM
That I know!
But I've accessed it through another domain, but this domain wasn't working on Frame Redirect!

It's the Frame Redirect that's making it cause error.

I've tryed all sorts of stuff. CHMODS, and everything. But then I came up with:

top.main

instead of

top.document.referrer

Which only generades the referrers as undefined!

But thanks for your help! Do you or anybody else know how to resolve it?
Thank you!