Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 18th, 2004, 01:59 PM
Authorized User
 
Join Date: Sep 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default CreatePopup

Hi, all,

I'm using CreatePopup and Show methods to show popup menus, which users can make selection and take them to other pages - this part is successful.

Now, I need to do the same, except when user clicks an item, it will open a document (pdf, doc or xls). I am trying to use something like this:
Code:
onClick="window.open('document.pdf','','width=950,height=600')"
. And it is not doing anything, except giving me a script error message, "not implemented'. What did I do wrong? I have no problem opening a document when I don't use the popups.

Thanks.

 
Old November 18th, 2004, 06:28 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I do not believe you can re-size Acrobat Readers window like a regular pop up window. You simply need a target="_blank" inside a regular anchr tag:
<a href="path/document.pdf" target="_blank">

Wind is your friend
Matt
 
Old November 18th, 2004, 06:47 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Correction, yes you can with a .pdf, it will hold the size you give it.

I had tried this with a word doc before without success. When word opens it pushes the widow size beyond for example the 500w x 500h I had previously tried. I just tried it again and experienced the same behaviours.

rweide
I have just reaslized you deleted your second post, all sorted is it?



Wind is your friend
Matt
 
Old November 19th, 2004, 09:06 AM
Authorized User
 
Join Date: Sep 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought it worked, then I realized I used onClick="parent.location.href='file.pdf'" to open this pdf (and spreadsheet) file, that's why I posted and deleted the second post.

Although, I might still with parent.location.href, but I hope to use window.open so that I can have more control, and it still doesn't work on me, how do you do it? Onclick="window.open(.....)"?

And I used the example from Microsoft site about popup object, so I am using <DIV onClick="..."></DIV>, instead of <A>.
 
Old November 19th, 2004, 03:36 PM
Authorized User
 
Join Date: Sep 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Update: I made it work by using parent.window.open, instead of just window.open. The document needs to be opened on the parent of the popup menu, not on the popup menu as my codes were trying to do.

Thanks for the help.









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.