Javascript标语链接在新窗口中打开 [英] Javascript banner link open in new window

查看:126
本文介绍了Javascript标语链接在新窗口中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有JavaScript代码的页面:

I have a page with a JavaScript code:

http://pastehtml.com/view/1d997i8.html

请查看源代码

打开页面时,将显示随机横幅.当我单击横幅时,我想在新窗口中打开横幅上的链接.

When you open the page a random banner will be displayed. When I click on the banner, i want to open the link on the banner in a new window.

现在它在同一窗口中打开.

Right now it opens on the same window.

感谢您的帮助.谢谢

推荐答案

您可以使用jQuery并在脚本中包含以下内容:

You could use jQuery and include the following in the script:

$('a').attr('target','_ blank');

$('a').attr('target','_blank');

这篇关于Javascript标语链接在新窗口中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆