Javascript 从asp.net中的iFrame获取值
我有一个asp.net web应用程序,它在aspx页面中使用iFrame(称为“fraContent”)。在iFrame中,我有一个隐藏字段(称为“hdnCounter”),它存储一个“counter”值 从父aspx页面,如何从iFrame访问该隐藏值Javascript 从asp.net中的iFrame获取值,javascript,asp.net,iframe,Javascript,Asp.net,Iframe,我有一个asp.net web应用程序,它在aspx页面中使用iFrame(称为“fraContent”)。在iFrame中,我有一个隐藏字段(称为“hdnCounter”),它存储一个“counter”值 从父aspx页面,如何从iFrame访问该隐藏值 警报(document.getElementById('window.fraContent.hdnCounter').value)似乎不起作用元素的ID不是window.fraContent.hdnCounter,因此getElementBy
警报(document.getElementById('window.fraContent.hdnCounter').value)代码>似乎不起作用元素的ID不是window.fraContent.hdnCounter
,因此getElementById
将不起作用
您只需要:alert(window.fraContent.document.getElementById('hdnCounter').value)