jquery - Open links in new window -


i have jquery script opens link in new window:

$(document).on('click', 'a.externalurl', function () {         window.open(this.href);     }); 

and in template got snippet of code:

{{#facebook}}   <a href="{{facebook}}" target="_blank">facebook</a> {{/facebook}} 

the problem is, it's opening localhost in url, in stead of going directly facebook.com.

example:

http://localhost:57391/www.facebook.com 

use "http://{{facebook}}" or "https://{{facebook}}" href attribute


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -