Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Location
    USA
    Posts
    54

    Unanswered: Using CreatePopup & Window.open

    I used Createpopup and Show methods to display popup menus.

    I am successful in going to other pages when user clicks an item on the popup menu by using "parent.location.href", but now I need to open a document (pdf, xls, doc, etc.) and place it on the browser. I am using "window.open", and it is not opening up the document, and instead, giving me a script error message telling me, "not implemented".

    What did I do wrong? Can this be done at all?

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    This is a JavaScript issue, not ASP... but if you post your code, we may be able to help you
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Aug 2004
    Location
    USA
    Posts
    54

    Angry

    Yes, I just realized this is javascript issue, but feel closer to ASP people. =)

    /
    Code:
    / this is how popup is created....
    <script Language=Javascript>
    var oPopup = window.createPopup();
    function richContext()
    {
        var lefter2 = event.offsetY+0;
        var topper2 = event.offsetX+15;
        oPopup.document.body.innerHTML = oContext2.innerHTML; 
        oPopup.show(topper2, lefter2, 210, 104, contextobox);
    }
    </script>
    HTML Code:
    // When this is clicked, menu pops up to show selections...
    <span id="contextobox" onmousedown="richContext(); return false" >Click to show popup</span>
    HTML Code:
    //This will be the content of popup menu...
    <DIV ID="oContext2" STYLE="display:none">
       <Div Onclick="window.open('http://rra.net/report.pdf','','width=950,height=600, top=10,left=10,resizable=yes,toolbar=no);return false;">Report 1</div>
    </Div>
    This code is actually from an example on MS website that talks about popup object. I simply replace the call to other web pages with an intention to open document files (pdf, spreadsheet, etc.). If I use parent.location.href, it does open the file on the same page, but I hope to use window.open to have more control of the page. And I love to find out why window.open is giving me "not implemented" message.

    BTW, The <DIV onClick="window.open(...)"> acutally works separately and independently, if it is outside the popup menu structure.

  4. #4
    Join Date
    Aug 2004
    Location
    USA
    Posts
    54
    I've found the solution.

    Instead of using window.open, I need to use parent.window.open, since the document can not be opened within the popup menu, but the parent of the popup menu, which is the main page.

    Thanks for helping.

Posting Permissions

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