Javascript open link in new tab
2015-01-01, 01:10 PM,
#1
Here is the code
Code:
$(window).resize(resize);

                $('#ok-btn').click(function(){
                    document.location.href = 'http://example.com/gotolink';
                });
How to open new tab when click on the link? I added "_blank" but no work at all :(
Latest Thanks - View all

uragunkid(2015-01-01 03:01 PM) 
Reply
2015-01-01, 03:14 PM,
#2
Latest Thanks - View all

immart247(2015-01-01 09:32 PM) 
Reply
2015-01-01, 04:46 PM,
#3
I do wonder why you choose to use javascript to perform this .. many mobile browser has javascript turned OFF by default. also, for desktop, there is 'Noscript' the famous browser extention that is estimated to get millions of installs per year. you are going to lose an amount of your traffic if you used javascript for your links.

why don't u use just HTML for this .. a simple example to do what you want in HTML can be:

<a href='http://www.cpaelites.com' target='_blank'>Click Here To Enter CPAELITES</a>
Reply
2015-01-01, 05:00 PM,
#4
(2015-01-01, 04:46 PM)ZeroDos Wrote: I do wonder why you choose to use javascript to perform this .. many mobile browser has javascript turned OFF by default. also, for desktop, there is 'Noscript' the famous browser extention that is estimated to get millions of installs per year. you are going to lose an amount of your traffic if you used javascript for your links.

why don't u use just HTML for this .. a simple example to do what you want in HTML can be:

<a href='' target='_blank'>Click Here To Enter CPAELITES</a>

Do you know how to made script working without javascript for all mobile device ?
I'm working on landing page that's need script for example "popin", "fake console", "field verification"...
Reply
2015-01-01, 07:53 PM,
#5
(2015-01-01, 05:00 PM)Vinz77 Wrote: Do you know how to made script working without javascript for all mobile device ?

Nope. i don't think that is possible unless you want to perform some simple tasks.
a simple PopUp can be done without javascript by using HTML and CSS.
Reply
2015-01-01, 08:48 PM,
#6
(2015-01-01, 07:53 PM)ZeroDos Wrote:
(2015-01-01, 05:00 PM)Vinz77 Wrote: Do you know how to made script working without javascript for all mobile device ?

Nope. i don't think that is possible unless you want to perform some simple tasks.
a simple PopUp can be done without javascript by using HTML and CSS.

Yes i've seen it with css animation but for complex script html and CSS should not working. I don't know how many percent mobile not compatible with javascript it is. Did someone know it ?
Reply
2015-01-01, 09:35 PM,
#7
(2015-01-01, 03:14 PM)BeHappy Wrote: /questions/5141910/javascript-location-href-to-open-in-new-window-tab
/questions/18476373/how-to-add-target-blank-to-javascript-window-location

window.open is best solution
I fixed it by copying the code from 1 of sites above (I googled it)
(2015-01-01, 04:46 PM)ZeroDos Wrote: I do wonder why you choose to use javascript to perform this .. many mobile browser has javascript turned OFF by default. also, for desktop, there is 'Noscript' the famous browser extention that is estimated to get millions of installs per year. you are going to lose an amount of your traffic if you used javascript for your links.

why don't u use just HTML for this .. a simple example to do what you want in HTML can be:

<a href='' target='_blank'>Click Here To Enter CPAELITES</a>
Not really sure if your information is correct or not.... How can you play youtube video without javascript? Because when I disable JS I can't play video
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  How do you create tab under? Ruriko 2 635 2017-02-11, 07:28 PM
Last Post: xakaa
  Help needed - Download link freakkz 3 529 2017-01-29, 10:23 PM
Last Post: CharlieHarper
  [SHARE} High Quality Javascript ALERTS! Mimo 0 1,016 2016-07-11, 05:13 PM
Last Post: Mimo
  Anyone good with Javascript? hawdaze 6 814 2015-11-09, 11:43 PM
Last Post: serpkiller
  URL Parameters to dynamically switch widgets/anchor link moyennes 2 514 2015-06-22, 04:02 AM
Last Post: devmd




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

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