[英]jQuery Attribute Usage for Target
谁能看到以下代码为什么没有在新窗口中打开我的网址顶部,即:
$(location).attr({
href: toLoad,
target: "_blank"
});
toLoad是我的网址。
从视图源看,一切似乎都很好,基本上看起来像:
<a target="_blank" title="" href="http://......etc">ccc</a>
有什么想法我可能做错了吗?
谢谢。
jQuery包装器用于DOM元素,而不是任意对象,并且location
( window.location
)甚至没有target
属性。 只需做一个window.open(...)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.