0 Replies Latest reply on Feb 1, 2011 6:41 PM by wilsonwf1

    Named Destinations with window.open

    wilsonwf1

      I have a ColdFusion application that opens a reference document to a specific point of reference.  I had been using an html page with anchors for the reference document but would like to use PDF with named destinations.

       

      The code I am using is from a button click event:

       

      <input type="button" value="Reference"
        onClick="var ptr = window.open('../reference/<cfoutput>#reflink# </cfoutput>','popup','width=600,height=600,scrollbars=yes,resizable=yes,toolbar=no,direct ories=no,location=no,menubar=yes,status=no,left=500,top=0'); if(ptr) ptr.focus(); return false">

       

      The reflink variable would be something like "myreference.html#myanchor for html and "myreference.pdf#mydestination" for pdf.

       

      The code works fine for html.  The click event pops the window and displays the anchor location.  Another event will refresh the existing open window with the new location.

       

      With the pdf, the first click works correctly.  The second click clears the document view to blank and the first window is effectively hung.  If I click again, a new window is opened and the first window remains blank.

       

      If I don't use named destinations, the window is refreshed each time with the pdf file and the not hung.  So the problem only occurs when there is a named destination in the URL.  But I need named destinations to zoom to the reference location.

       

      This occurs with IE 8.

       

      When I use Firefox, the behavior is different.  The window pops correctly, but after the first attempt, it does not navigate to the correct named destination.  Any subsequent click event results in the pdf file staying at the existing location.