Click to See Complete Forum and Search --> : strange javacript error (access is denied)


sgalmeida
05-14-2004, 08:26 AM
greetings

I'm getting a very strange javascript error.

on my paga I'm using a php script to preform the download operation of my files. the script is:

<?
if($_GET['file']){
header("Content-type: application/save");
header('Content-Disposition: attachment; filename="' . basename($_GET['file']) . '"');
header('Expires: 0');
header('Pragma: no-cache');
readfile($_GET['file']);
}
?>


and I'm using this script on a page that have several rollover images that works as links (I'm using dreamweaver as develop tool)

well, when I enter the page with the rollover images, everything works fine, all rollover images works as expected. But when I click on the download link (that uses the PHP script) the save dialog opens and if I cancel or save the file, all the rollover images stop to work, and I get the Javascript error "Access is denied"!!! The errors refers to the following functions:


function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array(); for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


and


function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


anyonehave an idea what is happening??



Thanks


Sérgio

kimmeke
05-14-2004, 10:01 AM
I get that error too, but that's becaus i use a sript to kill the banners..bye

Khalid Ali
05-14-2004, 10:03 AM
typically you will get this error if the resource you are trying to access is not located at the domain where you pages are located(such as from some other domain or a hard disk)

sgalmeida
05-14-2004, 11:45 AM
Originally posted by Khalid Ali
typically you will get this error if the resource you are trying to access is not located at the domain where you pages are located(such as from some other domain or a hard disk)

my files are located on a subdirectory (relative from where my script is located) called files.

it's all on the same machine and under the same directory... i don't understand what is happening....

thanks

kimmeke
05-14-2004, 12:24 PM
yea, here too:)

sgalmeida
05-14-2004, 12:27 PM
Originally posted by kimmeke
yea, here too:)

on mozilla works fine. damn M$