Javascript Help Needed
2013-12-28, 08:42 PM, (This post was last modified: 2013-12-28, 08:43 PM by eliter1q.)
#1
Hello friends,

I need a little help regarding a javascript code. Below is the code which generates a button like this [Image: button.jpg] but the problem is that when it is clicked, it opens the link in the same window but i want it to open the link in new tab or window.

Here is the script which i want to be modified.


<table id="tablegift1" cellpadding="0" cellspacing="0" border="0" width="100%" style="display:none;">
<tr id="gift2" class="hoverspan" onclick="PreventExitSplash=true; location.href='http://google.com';" style="cursor:pointer;">
<td style="padding:0 5px 5px 0;"><img src="images/photo1.jpg" id="photos"></td>
<td class="mid"><p><b>Download Link</b></font></p></td>
<td class="right" align="right"><form method="post" action="http://google.com"><input value="Download" type="submit" class="btnblue" onclick="PreventExitSplash=true;" /></form></td>
</tr>
</table>

Please make the necessary change in this script so that it opens the link in new tab.

Waiting for your replies.

Thanks,

My Recommended Web hosting Service. Get 1 Free Domain With Just 1 Click Wordpress Install!

[Image: bh-468x60-04-dy.png]
Reply
2013-12-28, 08:55 PM, (This post was last modified: 2013-12-28, 08:57 PM by KCMM.)
#2
To open link in the new tab you need to use target="_blank" attribute. Try this:

<input value="Download" type="submit" class="btnblue" target="_blank" onclick="PreventExitSplash=true;" />

This is HTML btw
Reply
2013-12-29, 10:22 AM,
#3
(2013-12-28, 08:55 PM)vorob Wrote: To open link in the new tab you need to use target="_blank" attribute. Try this:

<input value="Download" type="submit" class="btnblue" target="_blank" onclick="PreventExitSplash=true;" />

This is HTML btw

its still not working bro, its still opening the link in the same window. somebody please fix this code.

My Recommended Web hosting Service. Get 1 Free Domain With Just 1 Click Wordpress Install!

[Image: bh-468x60-04-dy.png]
Reply
2013-12-29, 10:32 AM,
#4
Use target attribute. But it wont work in internet explorer. Try target="_self"

use chrome to test.

Join The Best Network Today And Earn REAL Money! The secret to success lies here.

[Image: jqE21u3.gif]
Reply
2013-12-29, 10:40 AM, (This post was last modified: 2013-12-29, 11:01 AM by Rival.)
#5
(2013-12-28, 08:42 PM)eliter1q Wrote: Hello friends,

I need a little help regarding a javascript code. Below is the code which generates a button like this [img]/wlxkdr7u3/button.jpg[/img] but the problem is that when it is clicked, it opens the link in the same window but i want it to open the link in new tab or window.

Here is the script which i want to be modified.


<table id="tablegift1" cellpadding="0" cellspacing="0" border="0" width="100%" style="display:none;">
<tr id="gift2" class="hoverspan" onclick="PreventExitSplash=true; location.href='';" style="cursor:pointer;">
<td style="padding:0 5px 5px 0;"><img src="images/photo1.jpg" id="photos"></td>
<td class="mid"><p><b>Download Link</b></font></p></td>
<td class="right" align="right"><form method="post" action=""><input value="Download" type="submit" class="btnblue" onclick="PreventExitSplash=true;" /></form></td>
</tr>
</table>

Please make the necessary change in this script so that it opens the link in new tab.

Waiting for your replies.

Thanks,

hey man your onclick command is messing you up it should be
Code:
ONCLICK="window.location.href='http://www.test.com/'">
the test.com part is where the button would be pointing so add that and change it to whatever site you want then there ya go
Reply
2013-12-29, 10:56 AM, (This post was last modified: 2013-12-29, 11:12 AM by eliter1q.)
#6
(2013-12-29, 10:32 AM)Superhero99 Wrote: Use target attribute. But it wont work in internet explorer. Try target="_self"

use chrome to test.

could you please mention the complete code? I have no coding knowledge so i don't understand where and what to change.

Thanks,

(2013-12-29, 10:40 AM)RivalOfGod Wrote:
(2013-12-28, 08:42 PM)eliter1q Wrote: Hello friends,

I need a little help regarding a javascript code. Below is the code which generates a button like this [img]/wlxkdr7u3/button.jpg[/img] but the problem is that when it is clicked, it opens the link in the same window but i want it to open the link in new tab or window.

Here is the script which i want to be modified.


<table id="tablegift1" cellpadding="0" cellspacing="0" border="0" width="100%" style="display:none;">
<tr id="gift2" class="hoverspan" onclick="PreventExitSplash=true; location.href='';" style="cursor:pointer;">
<td style="padding:0 5px 5px 0;"><img src="images/photo1.jpg" id="photos"></td>
<td class="mid"><p><b>Download Link</b></font></p></td>
<td class="right" align="right"><form method="post" action=""><input value="Download" type="submit" class="btnblue" onclick="PreventExitSplash=true;" /></form></td>
</tr>
</table>

Please make the necessary change in this script so that it opens the link in new tab.

Waiting for your replies.

Thanks,

hey man your onclick command is messing you up it should be
Code:
ONCLICK="window.location.href='/'">
the test.com part is where the button would be pointing so add that and change it to whatever site you want then there ya go

sorry, not working :( or may be i am doing something wrong. I am a noob in coding :( Could you please write down the complete code making the changes wherever needed because i don't understand where and what to change. Please help me.

My Recommended Web hosting Service. Get 1 Free Domain With Just 1 Click Wordpress Install!

[Image: bh-468x60-04-dy.png]
Reply
2013-12-29, 11:35 AM,
#7
if you do what I said it will work However I will not do your work for you if you have no clue on coding you can always check out youtube and such and learn from there.
Reply
2013-12-29, 11:48 AM,
#8
Finally got it sorted. Thanks guys for all the help.

My Recommended Web hosting Service. Get 1 Free Domain With Just 1 Click Wordpress Install!

[Image: bh-468x60-04-dy.png]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  UAE traffic is urgently needed. 1moneyman123 2 146 2017-10-25, 11:35 PM
Last Post: interwent
  Traffic needed for cpa offers naulodesign 7 375 2017-10-06, 01:50 AM
Last Post: stephanie12
  No conversion help needed total newbie naulodesign 3 216 2017-09-21, 12:58 PM
Last Post: EnChanter
  Needed help with cent os 7 PoS3!DoN 3 118 2017-09-15, 12:23 AM
Last Post: GopherDomains
  Please!!! Suggestions needed for more online business models (cpa apart!)? HAkorehdeh 3 120 2017-09-03, 11:25 AM
Last Post: Watt





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top