chrome扩展 ,contentWindow.$ is not a function

document.getElementById("iframe").childNodes[0].contentWindow.$("#id").val();
提示:Error in event handler: TypeError: document.getElementById(...).childNodes[0].contentWindow.$ is not a function

1 先确认document.getElementById("iframe").childNodes[0]获取的是iframe元素
2 确认iframe嵌入的子页面的地址与父页面是同一域名的,没有跨域。
3 确认在获取.contentWindow.$("#id").val()时iframe嵌入的子页面已经加载完毕,可以在iframe元素的onload事件中获取.contentWindow.$("#id").val()。
4 确认子页面中引入了 jquery

是iframe元素 ,没有跨域。
在chrome浏览器的控制台输入document.getElementById("iframe").childNodes[0].contentWindow.$("#id").val()
可以得到正确的返回值。
但是将这条语句放在chrome扩展中执行,则报错 $ is not a function