When I use window.open("www.google.com", "_blank");
window.open("www.google.com", "_blank");
A new tab is opened, but the url isn't "www.google.com", it's "=url-i-was-at=/www.google.com".
This is a snippet of the code (and the only relevant code). http://jsfiddle.net/FUYTY/
In jsfiddle it behaves a bit differently, but still doesn't work as it should.
What am i doing wrong?
You have to prepend
http://
in your url:Fix: http://jsfiddle.net/FUYTY/4/
Preface your urls with
http://
You wanted to access the root document of server
www.google.com
, which is done using the urlhttp://www.google.com/
. You provided a relative url for documentwww.google.com
instead.Try adding http:// beforehand (see Fiddle http://jsfiddle.net/lkritchey/FUYTY/3/)
Some more information: If you include a '/' beforehand, it appends your string to the root URL. If you just list the string, it appends it to the current full URL. If you include either http:// or https:// it knows to use only what you put in your string (i.e. http://www.google.com)