Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one click, two urls. 1

Status
Not open for further replies.

PTmon

IS-IT--Management
Mar 8, 2001
284
US
Hi, I need a little help. I have a download page where people can choose from several brochures (PDF's). When they click on the brochure, I want it to pop open a new window with the PDF, and the background brochure page to switch to a thank you page. Here's what I tried:

Code:
<a target="_blank" href="brochures/#strFilename#" onClick="parent.frames[0].location.href='brochuresThankYou.cfm';">#strTitle#</a>

(Brochure listings are being fed from a database via coldfusion, that's why the #'s.)

Thanks in advance!
pt

putting the "new" in "newb".....
 
Do you have an iframe or frameset that you're not mentioning? It would affect the way that the code would work.

Incidentally, what about the people with JavaScript disabled? What should happen for them?

Dan




[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi Dan,
No iframes, no frames at all. Just the background page going to a thank you page, and the PDF popping up. For people without javascript, I can live with them just getting the PDF. basically the thank you page will be tranking my google ppc campaign.
Thanks!
pt

putting the "new" in "newb".....
 
OK - I asked because you had a reference to frames on your code. Try this for size:

Code:
<a href="brochures/#strFilename#" onclick="window.open(this.href, '', ''); this.href = 'brochuresThankYou.cfm';" target="_blank">#strTitle#</a>

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Ooops - that should have been:

Code:
<a href="brochures/#strFilename#" onclick="window.open(this.href, '', ''); this.href = 'brochuresThankYou.cfm'; this.target = '';" target="_blank">#strTitle#</a>

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
That is perfect! Thanks so much. Works exactly as I need it. Stars for you!
Thanks :)
pt

putting the "new" in "newb".....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top