Help with Remote Scripting on Safari

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Kraft

    Help with Remote Scripting on Safari

    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(fo rmName, formType) {
    if (!document.crea teElement) {return true};
    var IFrameDoc;
    var URL = 'setBasket.aspx ' + buildQueryStrin g(formName);
    if (!IFrameObj && document.create Element) {
    // 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=docu ment.createElem ent('iframe');
    tempIFrame.setA ttribute('id',' RSIFrame');
    tempIFrame.styl e.border='0px';
    tempIFrame.styl e.width='0px';
    tempIFrame.styl e.height='0px';
    IFrameObj = document.body.a ppendChild(temp IFrame);

    if (document.frame s) {
    // 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.user Agent.indexOf(' Gecko') !=-1
    && !IFrameObj.cont entDocument) {
    // we have to give NS6 a fraction of a second
    // to recognize the new IFrame
    setTimeout('cal lToServer()',10 );
    return false;
    }

    if (IFrameObj.cont entDocument) {
    // For NS6
    IFrameDoc = IFrameObj.conte ntDocument;
    } else if (IFrameObj.cont entWindow) {
    // For IE5.5 and IE6
    IFrameDoc = IFrameObj.conte ntWindow.docume nt;
    } else if (IFrameObj.docu ment) {
    // For IE5
    IFrameDoc = IFrameObj.docum ent;
    } else {
    return true;
    }
    IFrameDoc.locat ion.replace(URL );
    return false;
    }
    </CODE>
  • alexdavidson007

    #2
    Re: Help with Remote Scripting on Safari

    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.

    Comment

    Working...