我在一个HTML页面上使用了iframe,用于嵌套另外一个ShowArticleSendUsers.asp程序页面,以实现动态生成一个可选内容,现在我想用javascript获取iframe中动态生成的页面上,有多少个table对象。但当我尝试用如下脚本获取iframe子框架ShowArticleSendUsers.asp页面上有多少个table对象时,实际返回的结果却是iframe本身所在的页面中的表格对象个数,而不是我想要的iframe里面的ShowArticleSendUsers.asp表格个数请问我的脚本程序错在哪里,应该怎样写才能正确获取到ShowArticleSendUsers.asp的表格个数?
alert(document.getElementById('UserZone').document.getElementsByTagName('table').length);<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>办公自动化管理系统</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head><table id="UserZoneTable">
    <tr>
        <td>
            <iframe id="UserZone" name="UserZone" scrolling="yes" src="ShowArticleSendUsers.asp"></iframe>
        </td>
    </tr>
</table></form>
</body>
</html>