【发布时间】:2015-01-11 06:36:48
【问题描述】:
$(document).ready( ->
window.open $('[data-auto-popup]').find('a').attr("href"), "popupWindow", "width=600, height=600"
)
这将在我访问的所有页面上打开窗口;但我只希望它在具有数据属性的页面上弹出:data-auto-popup。这可能吗?
【问题讨论】:
-
你的意思是你只希望它在点击
[data-auto-popup]元素时打开? -
我希望它在提交表单后在该页面上打开。所以它会打开而无需点击。
-
你不是缺少
->吗?$(document).ready()毕竟想要一个函数作为它的参数。
标签: jquery coffeescript