【问题标题】:Getting a value from an iFrame in asp.net从 asp.net 中的 iFrame 获取值
【发布时间】:2011-08-24 14:17:11
【问题描述】:

我有一个在 aspx 页面中使用 iFrame(称为“fraContent”)的 asp.net Web 应用程序。在 iFrame 中,我有一个存储“计数器”值的隐藏字段(称为“hdnCounter”)。

如何从父 aspx 页面访问 iFrame 中的隐藏值?

alert(document.getElementById('window.fraContent.hdnCounter').value); 似乎不起作用

【问题讨论】:

    标签: javascript asp.net iframe


    【解决方案1】:

    元素的ID不是window.fraContent.hdnCounter,所以getElementById不起作用。

    您只需要:alert(window.fraContent.document.getElementById('hdnCounter').value)

    【讨论】:

      猜你喜欢
      • 2015-09-16
      • 2016-04-11
      • 1970-01-01
      • 2011-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-26
      相关资源
      最近更新 更多