Webmastersite.net
Register Log In

go to link AND open pop up window?

Comments on go to link AND open pop up window?

babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Feb 02, 2008 - 2:08 AM:

OK, this is a long shot as I don't know if it can be done.

I want a pop-up window to appear when a user clicks on a link. This window will contain a code that is specific to that link.

So, user clicks on link and is taken to external site, PLUS pop-up window opens. Reason is that I want to make sure users go to the site using my link, so I don't want them to have the code unless they click on the link.

Possible? Ideas?

I currently have link opening in a frame that showed the code at the top, but have just discovered that some sites will not work like that. Some merchants can't use a basket whilst in a frame and another simply skips immediately out of the frame so the user doesn't see the code.


hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Feb 02, 2008 - 7:02 PM:

Ok, here's a shot in the dark, didn't test it, but thought I'd share -

<a href="{LINKDETAILSURL}" onclick="window.open('{TRACKLINKURL}','newwin');">{LINKTITLE}</a>

Let me know if it works or not, I'm curious to see if I got even close.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 02, 2008 - 7:47 PM:

Should be possible with javascript. The link would be an onclick to a javascript function. www.google.com/search?hl=en...en+two+windows&btnG=Search
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Feb 03, 2008 - 2:23 AM:

Thanks both of you. Hai - it sort of works in that it opens a new window :-)

The problem I am having is that I can't get the new window to show the code. All I get is the actual fieldname so the window is just not relating to wsnlinks. (see attached)

The current code I have is....
 

<a href="link.php?id={LINKID}" {EXTERNALLINKS}
onclick="window.open('http://www.freewebbargains.com/index.php?id={LINKID}&
custom=yes&TID=couponcode','newwin');">{LINKTITLE}</a>



I have tried numerous different urls to open the new link, either they didn't work
or just produced this same result

Attached Files:
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Feb 03, 2008 - 10:20 PM:

Does the new window code actually work when it's not within the javascript?

Or what about maybe switching the 2 codes? Put the new window code in the href and the link in the new window. Does that work by chance?
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Feb 04, 2008 - 12:45 AM:

Nope - still just get the same.

It is obviously the
index.php?id={LINKID}

that is incorrect, but I am not sure what else to use other than the index.php
hai
Forum Regular

Usergroup: Customer
Joined: Apr 03, 2007
Location: NY & PA

Total Topics: 94
Total Comments: 339
hai
Posted Feb 04, 2008 - 11:50 AM:

Is the page you attached a screenshot of a custom template? If so then the link would be index.php?custom=yes&TID=custom-page, where page is the name of the custom template.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 04, 2008 - 3:48 PM:

scripts.webmastersite.net/w...ng-custom-templates-6.html
babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Feb 05, 2008 - 2:10 AM:





Thanks! I had put just id instead of linkid - all works great now smiling face
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.