最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - AngularJS $window.open('url', '_blank') directs to currentpath+url instead of url -

programmeradmin3浏览0评论

I am trying to open a new tab with a specific url.

When i enter

$window.open('www.example', '_blank') 

i do get a new tab, just like i wanted but instead of going to: www.example

im directed to: http://localhost:8080/www.example

It concatinates my input with my current address

How do i open a new tab with exactly the url i put in the input?

Thanks!

I am trying to open a new tab with a specific url.

When i enter

$window.open('www.example.', '_blank') 

i do get a new tab, just like i wanted but instead of going to: www.example.

im directed to: http://localhost:8080/www.example.

It concatinates my input with my current address

How do i open a new tab with exactly the url i put in the input?

Thanks!

Share Improve this question asked Jul 15, 2015 at 13:51 JonathanJonathan 231 silver badge3 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

Did you try $window.open('http://www.example.', '_blank') (that is, add http:// so it's not interpreted as a relative URL)?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论