【问题标题】:Jquery on new Window objects?Jquery 在新的 Window 对象上?
【发布时间】:2010-05-13 20:49:44
【问题描述】:

是否可以在新的 Window javascript 对象上使用 jQuery?

例子:

win = new Window('mywindow','width= 400', 'height=400');

win.getContent().innerHTML = xmlFindNodeContent(XmlHttp.responseXML, "windowHtml");

jQuery(win).ready(function(){
  do jQuery stuff on the new window here??
}); 

这样的事情可能吗?

注意:新的 Window() 函数在正常工作之前需要一些参数。像这样的:

window.open('mywindow','width=400,height=200')

【问题讨论】:

  • new Window() 应该做什么?它在我的浏览器中没有任何作用。

标签: javascript jquery


【解决方案1】:

我认为最好在新窗口上插入 jquery.min.js 并在那里执行 $(function(){// jquery stuff });

【讨论】:

  • 不,这正是我不想做的,因为解析到新窗口的 html 是从服务器端自动生成的。
【解决方案2】:

我尝试了自己在主题中编写的代码,效果很好!

为 jQuery 点赞!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-18
    • 2012-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-08
    相关资源
    最近更新 更多