SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2001
    Location
    Indy
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE 5 won't download file from openWindow

    I am using the javascriptpenWindow() function and can open a document from IE 5. However, I cannot Right click and download the file directly.

    I get an error that states Internet Explorer cannot download filename from openWindow. No such interface supported.

    This does not happen with Netscape.

    Does anyone have a solution to this problem?
    Thanks.

  2. #2
    SitePoint Member
    Join Date
    May 2001
    Location
    ON, Canada
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bonnie,
    take a look on the code below. I believe it makes IE behave the way you want. The trick is "return(false)" in the onClick argument and href attribute presense.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    <script language="JavaScript" type="text/javascript">
    <!--
    function openWnd(url, w, h)
    {
    if (navigator.appName.indexOf("Explorer") >= 0) {

    var wndHandle=window.open(url,"msWin"," width="+w.toString()+", height="+h.toString()+", scrollbars=yes, toolbar=yes, menubar=yes, history=yes, resizable");
    }
    else {
    var wndHandle=window.open(url,"s","height="+h.toString()+",width="+w.toString()+",resizable,scrollbars=yes, toolbar=yes, menubar=yes, history=yes");

    }
    }

    //-->
    </script>

    </head>
    <body>
    <a onClick="openWnd('http://www.microsoft.com',500,500); return(false);" href="http://www.microsoft.com">Microsoft.com</a>
    </body>
    </html>


    Let me know if it helped.

    Regards,
    Alex Osokin - CTO

    The Web Hosting Portal http://www.findsp.com
    Hosting Forums: http://www.findsp.com/forum
    Web Hosting Newsletter: http://www.findsp.com/hosting/newsletter


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •