简体   繁体   English

从超链接打开弹出窗口

[英]Open popup from hyperlink

I have this code in Google Map infobox which shows hyperlink once the user will open the infobox for the Google marker.我在谷歌地图信息框中有这个代码,一旦用户打开谷歌标记的信息框,它就会显示超链接。

I want once the user will click on that link the page to be open in popup window not in a new tab or new page.我希望一旦用户单击该链接,页面将在弹出窗口中打开,而不是在新标签或新页面中打开。 This is the code I have:这是我的代码:

infoWindow.setContent('<div style="width:200px;height:80px;"><IMG BORDER="0" width="100" height="50" style="margin-right:5px;" ALIGN="Left" SRC='+ decodeURIComponent(data.logofilename)+'>'+data.companyname+'<br /> ' + '<a href="/employer/application.aspx?PostingID='+data.postingid+'&GetPosting=True">' + data.jobtitle+'</a></div>');

Any idea how I can solve that?知道我该如何解决吗?

If you remove the target="_blank" in the href it will stop it from opening in a new tab and open it in the same page.如果删除 href 中的target="_blank" ,它将阻止它在新选项卡中打开并在同一页面中打开它。 You could also use an iframe or ajax to open up the page inside the info-box.您还可以使用iframe或 ajax 打开信息框内的页面。 If you write ajax it would allow you to run a web page in an <div></div> .如果您编写 ajax,它将允许您在<div></div>运行网页。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM