| | #1 |
| New Warrior Member Join Date: 2014 Location: Ludhiana
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
I need a onclick script for my site, i want that when somebody click on my page a new site get open in new window.
|
| |
| | #2 |
| Active Warrior Registered Member Join Date: 2013
Posts: 58
Thanks: 4
Thanked 16 Times in 12 Posts
| HTML Code: <html> <head> <title>Simple OnClick Script</title> </head> <body> Please click... <script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script> <script type="text/javascript"> $("body").on("click", function() { window.open("https://kindlebookspromotion.com", "_blank"); }); </script> </body> </html> |
| |
| | #3 | |
| WordPress Corecontributor Join Date: 2014 Location: Alabama
Posts: 75
Thanks: 85
Thanked 25 Times in 21 Posts
|
| |
| |
| The Following User Says Thank You to BDazzler For This Useful Post: |
| | #4 | |
| Warrior Member Join Date: 2014
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
|
The best way to implement is put the jquery on bottom and put, you page will load first and last jquery will load, the effect will be the same, but your seo score will be a bit higher. And the user experience goes up $(document).ready(function(){ $("body").on("click", function() { window.open("https://kindlebookspromotion.com", "_blank"); }); }); | |
| | ||
| |
| The Following User Says Thank You to xerious For This Useful Post: |
| | #5 |
| New Warrior Member Join Date: 2014 Location: Ludhiana
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thanks a lot guys, its working perfectly, now i hope i will earn some extra money too.
|
| |
| | #6 |
| New Warrior Member Join Date: 2014 Location: Ludhiana
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
xerious thanks for your valuable advice.
|
| |
| | #7 |
| New Warrior Member Join Date: 2014 Location: Ludhiana
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
Guys, i need one improvement in this script, i wanna visitors to remain on my site, now what happened when visitors click on my site a new windows open and they automatically leave my site. |
| |
| | #8 |
| New Warrior Member Join Date: 2014 Location: Ludhiana
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
Guys, i need one improvement in this script, i wanna visitors to remain on my site, now what happened when visitors click on my site a new windows open and they automatically leave my site. |
| |
| | #9 |
| Conceited Know-It-All Join Date: 2014 Location: Amurrica
Posts: 952
Thanks: 465
Thanked 1,136 Times in 503 Posts
|
Why not just do something like this? Code: <a href="http://www.example.com" rel="nofollow" target="_blank">Link text</a> |
| Last edited on 23rd Dec 2014 at 12:25 AM. Reason: Clarification | |
| |
| | #10 |
| New Warrior Member Join Date: 2014 Location: Ludhiana
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thanks for reply, but i need a onclick window and visitors remain on my site.
|
| |
|
| Bookmarks |
| Tags |
| onclick, script |
| |