If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Using CreatePopup & Window.open

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-18-04, 16:35
rweide rweide is offline
Registered User
 
Join Date: Aug 2004
Location: USA
Posts: 54
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?
Reply With Quote
  #2 (permalink)  
Old 11-18-04, 19:32
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #3 (permalink)  
Old 11-19-04, 08:56
rweide rweide is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 11-19-04, 16:07
rweide rweide is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On