【发布时间】:2011-12-07 10:15:39
【问题描述】:
如何从 iframe 表单 ID 中检索值,并将其调用到我的客户端 html。
(客户端html) 示例.html
<head>
<script>
function alertThis(){
alert(parent.myframe.formsubmit.a_token.value);
}
</script>
</head>
<body>
<iframe name = "myframe" src="http://domain.com/sample/index.php">
<button onClick = "alertThis();">Click Here</button>
</body>
(服务器端 php) index.php
<form name = "formsubmit">
<input id = "a_token" value="<?php echo $_SESSION['user'] ?>"/>
</form>
但它不返回任何内容。
【问题讨论】:
标签: php javascript html iframe client-side