Help with Remote Scripting on Safari

J

Joe Kraft

I'm hoping that someone can help me out before I lose what color I
have left in my hair. I'm developing a website that relies on quite a
bit of remote scripting (see code below) so I can process things
without reloading the page. Anyway, everything works fine on IE and
Netscape for both the Mac and PC, and I do get the right results in
Safari for the Mac (ie, the item is added to the basket) but it also
opens the download manager window and shows that it is trying to
download the file that I'm using to process things on the server side.

Does anyone know a way to stop Safari's download manager from popping
up?


<CODE>
function callToServer(formName, formType) {
if (!document.createElement) {return true};
var IFrameDoc;
var URL = 'setBasket.aspx' + buildQueryString(formName);
if (!IFrameObj && document.createElement) {
// create the IFrame and assign a reference to the
// object to our global variable IFrameObj.
// this will only happen the first time
// callToServer() is called
var tempIFrame=document.createElement('iframe');
tempIFrame.setAttribute('id','RSIFrame');
tempIFrame.style.border='0px';
tempIFrame.style.width='0px';
tempIFrame.style.height='0px';
IFrameObj = document.body.appendChild(tempIFrame);

if (document.frames) {
// this is for IE5 Mac, because it will only
// allow access to the document object
// of the IFrame if we access it through
// the document.frames array
IFrameObj = document.frames['RSIFrame'];
}
}

if (navigator.userAgent.indexOf('Gecko') !=-1
&& !IFrameObj.contentDocument) {
// we have to give NS6 a fraction of a second
// to recognize the new IFrame
setTimeout('callToServer()',10);
return false;
}

if (IFrameObj.contentDocument) {
// For NS6
IFrameDoc = IFrameObj.contentDocument;
} else if (IFrameObj.contentWindow) {
// For IE5.5 and IE6
IFrameDoc = IFrameObj.contentWindow.document;
} else if (IFrameObj.document) {
// For IE5
IFrameDoc = IFrameObj.document;
} else {
return true;
}
IFrameDoc.location.replace(URL);
return false;
}
</CODE>
 
A

alexdavidson007

This probably won't help you much, but i am having the same problem on
another site, when an iframe calls up an ad. If you have any more info
on this, it would be much apreciated.
 

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,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top