场景是窗口作为参数传递给函数,我还需要使用窗口文档来搜索函数中的元素。不知道如何通过$(winObjParamter)获取文档对象.winObjParamter是传递给函数的参数。
答案 0 :(得分:3)
document
is a property of window
,因此您可以像访问其他任何属性一样访问它:
var doc = winObjParamter.document;
与上述相关联的MDN文章指出document
:
返回对窗口中包含的文档的引用。
答案 1 :(得分:0)
只需使用winObjParamter.document
获取窗口的document
对象。