开发者

Open in a new tab

In my application, I have a map (esri), that runs on javascript. When I click a point, I do a simple identify, no need to dig into details here

When the identify is successful, I open up a popup, based on the parameters of the point - no magic here.

The current code looks like this

 if (confirm("Do you want to see my secret information?"))
 {
      var newWindow = window.open("http://www.google.com, "mywindow", "scrollbars=yes,menubar=0,resizable=1,width=1000,height=650");
      if (window.focus) {newWindow.focus()}
 }

Well, this approach works, however, my users should not setup their popup blockers to allow my site, and IOS users are not at all able to use this - not good.

I want a more reliable wa开发者_JAVA技巧y to show them this infomation, like opening the windows in a new tab. If I had a <a href='http://www.google.com' target=_blank>google</a>

In a map, I do not have elements, that I can make to links.

How can I use confirm('smth'), and when successful, do the action of a normal link?


Maybe it's worth to change the way it works - when user clicks on a point display a DIV popup with the link like:

<a href='http://www.google.com' target=_blank onclick="return confirm('Do you want to see my secret information?')">google</a>

I don't think that there's an easy way to imitate a click on the link.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜