javascript调用iframe中的函数
我在网页webform1.aspx中插入了一个iframe,
<IFRAME id="iframe11" name="interfaceFrame" src="iForm.htm" width="490" height="80"></IFRAME>
然后在 button 中调用iframe中的函数
<input type="button" value="Mapidd定位" onClick="javascript:interfaceFrame.locateMap('8765')">
这样是行的
但是我把调用放在form里后总是报错:
“Microsoft JScript 运行时错误: 对象不支持此属性或方法”
<script language=javascript>
interfaceFrame.locateMap('8765');
</script>
</form>
</body>
</HTML>
怎样在document中直接调用iframe中的函数,不用button_click或其他事件激发