文章目录
结论
在新的固件版本的光猫中,对于 SN 认证等设置的禁用在浏览器端和服务端同时添加了限制措施,因此,仅仅在浏览器里是无法突破这一禁用限制的。
调用链接
<!-- 调用链接示例 -->
<a class="class3_space" id="ssmSN" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=pon_net_sn_t.gch')">SN认证</a>
// 这个函数用于处理链接的点击事件
function openLink(pageurl) {
// 清除页面上所有元素的点击事件
removeAllClick();
// 处理URL,进行一些编码或格式调整
var replaceurl = ReplaceDemo(pageurl);
// 检查一个标志,判断是否有上传操作正在进行
var tag = getObj("IF_UPLOADING").value;
// 如果有上传操作正在进行,则阻止页面跳转
if (tag == "1") {
top.mainFrame.location.href = "#"; // 通常用于阻止刷新或跳转
} else {
// 否则,将页面重定向到处理后的URL
top.mainFrame.location.href = replaceurl;
}
}
// 这个函数用于清除页面上所有元素的onclick属性
function removeAllClick() {
// 获取页面上所有的元素
var ele = document.getElementsByTagName("*");
// 遍历所有元素
for (var i = 0; i < ele.length; i++) {
// 如果元素有onclick属性,则清空它
if (ele[i] && ele[i].getAttribute("onclick") != "")
ele[i].setAttribute("onclick", "");
}
}
// 这个函数用于处理URL中的空格,将它们替换为" "
function ReplaceDemo(ss) {
// 定义一个正则表达式,用于匹配所有的空格
var re = / /g;
// 使用正则表达式替换URL中的空格
var r = ss.replace(re, " ");
// 返回处理后的URL
return r;
}
点击链接时 openLink函数被调用,它首先清除页面上所有元素的点击事件(通过removeAllClick函数),然后基于某些条件决定重定向到的URL。在重定向之前,URL会通过ReplaceDemo函数进行处理,将空格替换为 ,以适应URL编码规则。
抽取上述JavaScript代码中执行页面跳转的核心操作,忽略掉那些用于检查和预防的代码,关键的一行是:top.mainFrame.location.href = targetURL;
。
它是将mainFrame(通常指的是页面中的主框架或iframe)的location.href属性设置为targetURL。location.href属性代表当前窗口或框架的URL,将其设置为新的值会引发页面跳转至该新URL。top.mainFrame 确保了跳转发生在顶级窗口的主框架中,这在多框架或嵌套iframe的页面布局中非常重要,以确保跳转发生在正确的上下文中,而不是仅仅在当前的iframe或子框架中。
点击“确定”按钮后的提交表单流程
核心控件
<!-- 页面展示的那个“SN认证”的输入框,禁用状态 -->
<input name="Frm_Sn" id="Frm_Sn" type="text" value="" class="inputId" disabled="">
<!-- 隐藏的 Sn 项,实际提交表单中的 Sn 参数 -->
<input type="hidden" name="Sn" id="Sn" value="ZTEGxxxxxxxx">
<!-- 提交按钮,通过绑定事件来触发调用 pageSubmit() -->
<input name="Submit" type="button" id="Btn_Submit" class="button" value=" 确 定 ">
提交表单核心主流程
/*
****************************************
* 提交表单的处理入口函数 *
****************************************
*/
function pageSubmit() {
if (pageCheckValue() == true) { // 如果表单数据验证通过
DisableALL(); // 禁用所有表单元素,防止用户进一步修改
pageSetValue(); // 设置表单的值,确保所有数据都被收集
setValue("flag", "1"); // 设置标志位
setValue("IF_ACTION", "apply"); // 设置表单操作类型
formSubmit(); // 提交表单
}
}
// 验证表单值的函数,主要检查SN(序列号)的格式
function pageCheckValue() {
var snValue = getValue("Frm_Sn"); // 获取SN输入值
if (SnCheck(snValue) == false) { // 如果SN格式不正确
// 显示错误信息并返回false,阻止表单提交
return false;
}
return true; // 如果验证通过,返回true
}
// 获取指定ID的表单元素的值
function getValue(id) {
var obj_ID = getObj(id); // 获取DOM元素
// 根据不同的情况返回元素的值或安全控制值
if (safeCtls.disabledCtls[id] != undefined) {
return safeCtls.disabledCtls[id];
} else if (safeCtls.displayCtls[id] != undefined) {
return safeCtls.displayCtls[id];
} else {
return obj_ID.value;
}
}
// 通用的获取DOM元素的函数
function getObj(id) {
return (document.getElementById(id)); // 返回ID对应DOM元素
}
// SN格式检查函数
function SnCheck(Key) {
// 检查SN长度是否为12
if (Key.length != 12) {
return false;
}
// 检查前4个字符是否为字母
for (var j = 0; j < 4; j++) {
var ch = Key.charCodeAt(j);
if (!((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122))) {
return false;
}
}
// 检查剩余字符是否为16进制的字母或数字
for (var j = 4; j < Key.length; j++) {
var ch = Key.charCodeAt(j);
if (!((ch >= 65 && ch <= 70) || (ch >= 97 && ch <= 102) || (ch >= 48 && ch <= 57))) {
return false;
}
}
return true; // 如果所有检查都通过,返回true
}
// 禁用所有表单元素的函数
function DisableALL() {
// 禁用所有输入框
var txtArrs = document.getElementsByTagName('input');
for (var i = 0; i < txtArrs.length; i++) {
if (txtArrs[i].type != "hidden") {
txtArrs[i].disabled = true;
}
}
// 禁用所有下拉列表
var selectArrs = document.getElementsByTagName('select');
for (var i = 0; i < selectArrs.length; i++) {
selectArrs[i].disabled = true;
}
// 特殊处理help_info元素
if (getObj("help_info") != null) {
getObj("help_info").disabled = false;
}
}
// 设置表单值的函数,确保所有需要的数据都被收集
function pageSetValue() {
HiddenParaInit(PON_PARA); // 初始化隐藏参数
setValue("Sn", getValue("Sn")); // 设置Sn值
}
// 初始化隐藏参数的函数
function HiddenParaInit(arr) {
for (var i = 0; i < arr.length; i++) {
setValue(arr[i], "NULL"); // 设置隐藏参数的值为NULL
}
}
// 通用的设置元素值的函数
function setValue(id, value) {
var obj_ID = getObj(id); // 获取元素
// 根据不同情况设置元素的值
if (safeCtls.disabledCtls[id] != undefined) {
safeCtls.disabledCtls[id] = value;
}
if (safeCtls.displayCtls[id] != undefined) {
safeCtls.displayCtls[id] = value;
}
obj_ID.value = value;
}
// 提交表单的函数
function formSubmit() {
handleBeforeSubmit(); // 处理提交前的准备工作
getObj("fSubmit").submit(); // 提交表单
}
// 提交前处理函数,包括数据收集与编码
function handleBeforeSubmit() {
var form = getObj("fSubmit"); // 获取表单
if (form == null) {
return;
}
var inputParams = ""; // 初始化参数字符串
// 收集表单所有元素的值
var childNode = getFirstElementChild(form);
while (childNode != getLastElementChild(form)) {
if (childNode.getAttribute("id") != null) {
inputParams += childNode.id + "=" + encodeURIComponent(childNode.value) + "&";
}
childNode = getNextElementSibling(childNode);
}
inputParams += childNode.id + "=" + encodeURIComponent(childNode.value);
// 处理编码
if (getObj("IF_ENCODE") != null) {
var encodeNode = getObj("IF_ENCODE").cloneNode();
form.innerHTML = "";
form.appendChild(encodeNode);
} else {
setEncodePara();
}
// 创建并设置编码参数
var enpaInput = document.createElement("input");
enpaInput.setAttribute("id", "IF_ENCODEPARAM");
enpaInput.setAttribute("name", "IF_ENCODEPARAM");
enpaInput.setAttribute("type", "hidden");
form.appendChild(enpaInput);
enpaInput.setAttribute("value", String(encodeStr(inputParams)));
}
// 函数:设置编码参数
function setEncodePara() {
if (typeof(window.parent.EncodeKey) != "function") {
return;
}
var key = randomNum(16); // 生成16位随机密钥
var iv = randomNum(16); // 生成16位初始化向量
var encodeStr = window.parent.EncodeKey(key, iv); // 使用父窗口的EncodeKey方法加密
if (encodeStr.length == 0 || encodeStr == "false") {
return;
}
var subForm = getObj("fSubmit"); // 获取表单对象
var enpaInput = document.createElement("input"); // 创建隐藏输入元素
enpaInput.setAttribute("id", "IF_ENCODE"); // 设置ID
enpaInput.setAttribute("name", "IF_ENCODE"); // 设置name属性
enpaInput.setAttribute("type", "hidden"); // 设置类型为隐藏
enpaInput.setAttribute("value", encodeStr); // 设置值为加密后的字符串
if (subForm) {
subForm.appendChild(enpaInput); // 将元素添加到表单中
} else {
if (getObj("IF_ENCODE") != null) {
setValue("IF_ENCODE", encodeStr); // 如果IF_ENCODE已存在,更新其值
} else {
document.body.appendChild(enpaInput); // 否则,将元素添加到文档体中
}
}
document.key = key; // 保存密钥供其他地方使用
document.iv = iv; // 保存初始化向量
}
// 函数:编码字符串
function encodeStr(src) {
var dst = src;
if (document.key && document.iv && src.length > 0) {
if (typeof(window.parent.EncodePara) == "function") {
dst = window.parent.EncodePara(src, document.key, document.iv); // 使用父窗口的EncodePara方法加密
}
}
return dst; // 返回加密后的字符串
}
处理一个表单的提交流程,包括验证表单数据(尤其是SN序列号的格式)、禁用表单元素以防止用户进一步修改、收集表单数据并进行必要的编码处理、以及最终提交表单至服务器。
初始化核心代码(涉及提交表单相关部分)
// 初始化变量声明
var safeCtls = { // 存储被禁用或隐藏的控件及其状态的对象
disabledCtls: new Array(), // 被禁用的控件列表
displayCtls: new Array() // 被隐藏的控件列表
};
var PON_PARA = new Array("Sn", "Pwd"); // 隐藏参数数组,该数组的控件的值会在提交表单流程里被初始化为 NULL !!
/*
****************************************
* 此处调用执行初始化的入口函数 *
****************************************
*/
addToken2AllForms();
// 执行初始化的入口函数
function addToken2AllForms() {
function doAddLogic() { // 实际添加逻辑的内部函数
var session_token = "3JLsdHDxIuu5x1db00cOdiZc"; // 定义会话令牌
var forms = document.getElementsByTagName("form"); // 获取所有表单元素
for (var i = 0; i < forms.length; i++) {
var tempform = forms[i];
var sEnctype = tempform.getAttribute("enctype"); // 获取表单的编码类型
if (sEnctype != null && "multipart/form-data" == sEnctype.toLowerCase()) {
continue; // 如果是multipart/form-data类型,跳过此表单
}
var tokenInput = document.createElement("input"); // 创建一个新的<input>元素
tokenInput.setAttribute("id", "_SESSION_TOKEN"); // 设置元素的ID
tokenInput.setAttribute("name", "_SESSION_TOKEN"); // 设置元素的name属性
tokenInput.setAttribute("type", "hidden"); // 设置元素的类型为隐藏
tokenInput.setAttribute("value", session_token); // 设置元素的值为会话令牌
tempform.appendChild(tokenInput); // 将元素添加到表单中
}
}
// 确保在页面加载完毕后执行doAddLogic
if (window.onload == null) {
window.onload = function() {
doAddLogic(); // 执行添加会话令牌的逻辑
myOnLoad(); // 执行自定义的onload函数
};
} else {
var tempfunction = window.onload; // 保存现有的onload函数
window.onload = function() {
tempfunction(); // 执行原有的onload函数
doAddLogic(); // 执行添加会话令牌的逻辑
myOnLoad(); // 执行自定义的onload函数
};
}
}
// 自定义的onload函数,处理页面加载完成后的各种事件绑定
function myOnLoad() {
menuDisp(); // 显示菜单的函数调用
addEvent(getObj("htmlBody"), "keydown", setenter); // 注册键盘按下事件
addEvent(getObj("htmlBody"), "keyup", setinnerHidden); // 注册键盘抬起事件
addEvent(getObj("htmlBody"), "mousedown", setinnerHidden); // 注册鼠标按下事件
// 遍历并为每个按钮添加点击事件处理器
["Btn_Add", "Btn_DoEdit", "Btn_Delete", "Btn_Submit", "Btn_ReFresh", "Btn_Cancel", "Btn_Back"].forEach(function(btnId) {
if (getObj(btnId)) {
addEvent(getObj(btnId), "click", pageAdd);
addEvent(getObj(btnId), "click", handleRemoveClickEvent);
}
});
handleF5Refresh(); // 处理F5刷新事件的函数调用
fnBreakWordAll({word: 15, re: '[\\w]'}); // 分词处理的函数调用
framedispalay('myiframe'); // 显示iframe的函数调用
getObj("myLayer").style.left = "580px"; // 设置myLayer层的位置
getObj("myLayer").style.top = "137px"; // 设置myLayer层的位置
pageLoad(getURL("pon\x5fnet\x5fsn\x5ft\x2egch")); // 加载页面内容的函数调用
var newlocation = parseInt(getObj("myLayer").style.top) + 43; // 计算新的位置
getObj("myLayer").style.top = newlocation + "px"; // 更新myLayer层的位置
getPageDisabledObj(); // 获取页面上被禁用或隐藏的控件的函数调用
}
// 收集页面上被禁用或隐藏的控件及其状态的函数
function getPageDisabledObj() {
var inputArr = document.getElementsByTagName("input"); // 获取所有<input>元素
var selectArr = document.getElementsByTagName("select"); // 获取所有<select>元素
for (var i = 0; i < inputArr.length; i++) {
var elem = inputArr[i];
if (elem.disabled) { // 如果元素被禁用
safeCtls.disabledCtls[elem.id] = elem.type === "checkbox" ? elem.checked : elem.value; // 保存状态
}
if (elem.style.display === "none") { // 如果元素被隐藏
safeCtls.displayCtls[elem.id] = elem.type === "checkbox" ? elem.checked : elem.value; // 保存状态
}
}
for (var i = 0; i < selectArr.length; i++) {
var elem = selectArr[i];
if (elem.disabled) { // 如果元素被禁用
safeCtls.disabledCtls[elem.id] = elem.value; // 保存状态
}
if (elem.style.display === "none") { // 如果元素被隐藏
safeCtls.displayCtls[elem.id] = elem.value; // 保存状态
}
}
}
PON_PARA
是一个数组,它在脚本加载时就被初始化为包含两个字符串元素"Sn"
和"Pwd"
。这个数组的用途是在后续的表单提交流程中,将数组中列出的控件的值初始化为NULL
。safeCtls
是一个对象,它包含了两个属性disabledCtls
和displayCtls
,这两个属性都被初始化为数组。这个对象的目的是用来存储页面上被禁用(disabled
)或者被隐藏(display
设为none
)的控件的状态。这些状态在getPageDisabledObj
函数中被收集。该函数遍历页面上的所有<input>
和<select>
元素,如果发现某个元素被禁用或被隐藏,它就会将这个元素的ID和值(或选中状态)存储到safeCtls.disabledCtls
或safeCtls.displayCtls
中。
分析结论
要点解析
- SN格式要求:12位字符,前4位字母后8位十六进制数。
- 隐藏控件Sn控件的value会被最后作为提交表单的参数,是表单实际的SN的输入。
- Sn控件名称被初始化进入PON_PARA数组,在表单提交流程中,其值会被置为NULL。(导致修改Sn控件的value无法生效)
- Frm_Sn控件是禁用状态,在初始化时会将该控件名称和值(即加载的Sn控件的默认值)添加到safeCtls.disabledCtls中,从而在之后的任何getValue()时,都无法获取页面上的控件值,而是替代使用safeCtls.disabledCtls中初始化的值。(导致修改Frm_Sn控件的value无法生效)
调试要点
- 在开发者工具的控制台使用
PON_PARA.splice(0,1)
来清除初始化对Sn控件的限制。之后,可以生效对Sn控件的值修改。 - 在开发者工具的控制台使用
delete safeCtls.disabledCtls['Frm_Sn']
来清除初始化对Frm_Sn控件的限制。之后,可以生效对Frm_Sn控件的值修改。 - 终极方法:对鼠标点击事件的监听后,在单步执行的调试中,直接在最后一步
handleBeforeSubmit()
函数中,修改提交前的inputParams
字符串为自己所需要的参数值。
在Chrome中监听鼠标点击事件并单步调试
- 打开Chrome浏览器并导航至你想要调试的网页。
- 右键点击页面,选择“检查”或按
Ctrl+Shift+I
(Windows)或Cmd + Opt + I
(MacOS)快捷键打开开发者工具。 - 切换到“Sources”标签页,找到并打开你想要调试的JavaScript文件。
- 可以多种方式来设置监听和断点:
- 在“事件监听器断点”中选中“鼠标”下的“click”事件。
- 在代码中找到你希望监听点击事件并调试的元素或函数,设置断点。
- 使用
addEventListener
或修改DOM元素的onclick
属性,添加监听鼠标点击事件的处理函数。
- 点击提交按钮等来触发相关的事件,使设置的断点有机会被命中。
- 当点击事件发生时,代码将在断点处暂停,允许你查看当前“作用域”内的变量、调用堆栈和执行上下文。并可以添加表达式或变量到“监视”视窗。
- 使用开发者工具的“Step Over”(逐行执行)、“Step Into”(进入函数内部)和“Step Out”(跳出函数)按钮进行单步调试。
- 观察变量的变化,检查函数的执行流程,直到找到问题所在或完成调试。
调试结论
成功修改了浏览器端的Sn、Frm_Sn等控件的相关参数,并成功提交,但是光猫的SN值并未发生改变。所以,是光猫的服务器端脚本做了相关限制处理,只是在浏览器里所做的任何修改都是无法SN设置的禁用限制的。
附录
代码来源光猫信息
项目 | 信息 |
---|---|
设备型号 | ZXHN F673AV9a |
硬件版本号 | V9.0 |
软件版本号 | V2.2.0P1T11 |
提交表单的处理、初始化的所有依赖函数的完整代码
function pageSubmit() {
if (pageCheckValue() == true) {
DisableALL();
pageSetValue();
setValue("flag", "1");
setValue("IF_ACTION", "apply");
formSubmit();
}
}
function pageCheckValue() {
var msg = "";
var checkChar = "";
var arrayChar = new Array();
var snValue = getValue("Frm_Sn");
if (SnCheck(snValue) == false) {
msg = getmsg(809);
ShowErrorForCom("Frm_Sn", "Fnt_Sn", msg);
return false;
}
return true;
}
function getValue(id) {
var obj_ID = getObj(id);
if (safeCtls.disabledCtls[id] != undefined) {
return safeCtls.disabledCtls[id];
} else if (safeCtls.displayCtls[id] != undefined) {
return safeCtls.displayCtls[id];
} else {
return obj_ID.value;
}
}
function getObj(id) {
return (document.getElementById(id));
}
function SnCheck(Key) {
if (Key.length != 12) {
return false;
}
for (var j = 0; j < 4; j++) {
var ch = Key.charCodeAt(j);
if (!((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122))) {
return false;
}
}
for (var j = 4; j < Key.length; j++) {
var ch = Key.charCodeAt(j);
if (!((ch >= 65 && ch <= 70) || (ch >= 97 && ch <= 102) || (ch >= 48 && ch <= 57))) {
return false;
}
}
return true;
}
function getmsg(id) {
var str = new Array();
str[0] = new Array(807, "设备重启需要2~3分钟,请耐心等待。");
str[1] = new Array(808, "你确定需要重启设备吗?");
str[2] = new Array(809, "有误,请输入12位字符,前4位字母后8位十六进制数。");
return getMsgFormArray(str, arguments);
}
function getMsgFormArray(str, arg) {
var errid = 0;
var min = 0;
var max = 0;
var param = -1;
var msg = "";
var num = arg.length;
if (num == 1) {
errid = arg[0];
} else if (num == 3) {
errid = arg[0];
min = arg[1];
max = arg[2];
} else if (num == 2) {
errid = arg[0];
param = arg[1];
} else return null;
for (var i = 0; i < str.length; i++) {
if (typeof(str[i]) == "undefined") {
alert("数组初始化有误,请检查代码!i = " + i);
return null;
}
if (errid == str[i][0]) {
if (min == max && min == 0) {
if (param == -1) {
msg = str[i][1];
} else {
msg = str[i][1] + param + str[i + 1][1];
}
} else msg = str[i][1] + min + "~" + max + str[i + 1][1];
return msg;
}
}
return null;
}
function ShowErrorForCom(frmid, fntid, msg) {
var fntmsg;
var strmsg;
if (document.getElementById(fntid) == null) {
if (fntid == null) fntmsg = "";
else fntmsg = fntid;
} else {
fntmsg = document.getElementById(fntid).innerHTML;
}
strmsg = fntmsg + msg;
ShowError(document.getElementById(frmid), strmsg);
}
function ShowError(ctl, msg) {
var tmpStr = g_errorInfo;
if (tmpStr == "undefined") {
tmpStr = "Error";
}
document.getElementById("errnote").innerHTML = tmpStr;
document.getElementById("errmsg").innerHTML = msg;
document.getElementById("myLayer").style.visibility = "visible";
if (ctl != null && ctl.disabled == false) {
try {
ctl.focus();
} catch (e) {}
}
}
function DisableALL() {
var txtArrs = document.getElementsByTagName('input');
var selectArrs = document.getElementsByTagName('select');
for (var i = 0; i < txtArrs.length; i++) {
if (txtArrs[i].type != "hidden") {
txtArrs[i].disabled = true;
}
}
for (var i = 0; i < selectArrs.length; i++) {
selectArrs[i].disabled = true;
}
if (getObj("help_info") != null) {
getObj("help_info").disabled = false;
}
}
function pageSetValue() {
HiddenParaInit(PON_PARA);
setValue("Sn", getValue("Sn"));
}
function HiddenParaInit(arr) {
var val;
for (var i = 0; i < arr.length; i++) {
val = arr[i];
setValue(val, "NULL");
}
}
function setValue(id, value) {
var obj_ID = getObj(id);
if (safeCtls.disabledCtls[id] != undefined) {
safeCtls.disabledCtls[id] = value;
}
if (safeCtls.displayCtls[id] != undefined) {
safeCtls.displayCtls[id] = value;
}
obj_ID.value = value;
}
function formSubmit() {
handleBeforeSubmit();
getObj("fSubmit").submit();
}
function handleBeforeSubmit() {
var form = getObj("fSubmit");
if (form == null) {
return;
}
var inputParams = "";
var enpaInput = null;
var childNode = getFirstElementChild(form);
while (childNode != getLastElementChild(form)) {
if (childNode.getAttribute("id") != null) {
inputParams += childNode.id + "=" + encodeURIComponent(childNode.value) + "&";
}
childNode = getNextElementSibling(childNode);
}
inputParams += childNode.id + "=" + encodeURIComponent(childNode.value);
if (getObj("IF_ENCODE") != null) {
var encodeNode = getObj("IF_ENCODE").cloneNode();
form.innerHTML = "";
form.appendChild(encodeNode);
} else {
form.innerHTML = "";
setEncodePara();
}
enpaInput = document.createElement("input");
enpaInput.setAttribute("id", "IF_ENCODEPARAM");
enpaInput.setAttribute("name", "IF_ENCODEPARAM");
enpaInput.setAttribute("type", "hidden");
form.appendChild(enpaInput);
enpaInput.setAttribute("value", String(encodeStr(inputParams)));
}
function getFirstElementChild(element) {
if (element.firstElementChild) {
return element.firstElementChild;
} else {
var node = element.firstChild;
while (node && node.nodeType != 1) {
node = node.nextSibling;
}
return node;
}
}
function getLastElementChild(element) {
if (element.lastElementChild) {
return element.lastElementChild;
} else {
var node = element.lastChild;
while (node && node.nodeType != 1) {
node = node.previousSibling;
}
return node;
}
}
function getNextElementSibling(element) {
if (element.nextElementSibling) {
return element.nextElementSibling;
} else {
var node = element.nextSibling;
while (node && node.nodeType != 1) {
node = node.nextSibling;
}
return node;
}
}
function setEncodePara() {
if (typeof(window.parent.EncodeKey) != "function") {
return;
}
var key = randomNum(16);
var iv = randomNum(16);
var encodeStr = window.parent.EncodeKey(key, iv);
if (encodeStr.length == 0 || encodeStr == "false") {
return;
}
var subForm = getObj("fSubmit");
var enpaInput = document.createElement("input");
enpaInput.setAttribute("id", "IF_ENCODE");
enpaInput.setAttribute("name", "IF_ENCODE");
enpaInput.setAttribute("type", "hidden");
enpaInput.setAttribute("value", encodeStr);
if (subForm) {
subForm.appendChild(enpaInput);
} else {
if (getObj("IF_ENCODE") != null) {
setValue("IF_ENCODE", encodeStr);
} else {
document.body.appendChild(enpaInput);
}
}
document.key = key;
document.iv = iv;
}
function randomNum(n) {
var t = '';
for (var i = 0; i < n; i++) {
t += Math.floor(Math.random() * 10);
}
return t;
}
function encodeStr(src) {
var dst = src;
if (document.key && document.iv && src.length > 0)
if (typeof(window.parent.EncodePara) == "function") dst = window.parent.EncodePara(src, document.key, document.iv);
return dst;
}
var g_errorInfo = "错误信息";
var timeid;
var safeCtls = {
disabledCtls: new Array(),
displayCtls: new Array()
};
var PON_PARA = new Array("Sn", "Pwd");
addToken2AllForms();
function addToken2AllForms() {
function doAddLogic() {
var session_token = "3JLsdHDxIuu5x1db00cOdiZc";
var forms = document.getElementsByTagName("form");
for (var i = 0; i < forms.length; i++) {
var tempform = forms[i];
var sEnctype = tempform.getAttribute("enctype");
if (sEnctype != null && "multipart/form-data" == sEnctype.toLowerCase()) {
continue;
}
var tokenInput = document.createElement("input");
tokenInput.setAttribute("id", "_SESSION_TOKEN");
tokenInput.setAttribute("name", "_SESSION_TOKEN");
tokenInput.setAttribute("type", "hidden");
tokenInput.setAttribute("value", session_token);
tempform.appendChild(tokenInput);
}
}
if (window.onload == null) {
window.onload = function() {
doAddLogic();
myOnLoad();
}
} else {
var tempfunction = window.onload;
window.onload = function() {
tempfunction();
doAddLogic();
myOnLoad();
}
}
}
function myOnLoad() {
menuDisp();
addEvent(getObj("htmlBody"), "keydown", setenter);
addEvent(getObj("htmlBody"), "keyup", setinnerHidden);
addEvent(getObj("htmlBody"), "mousedown", setinnerHidden);
if (getObj("Btn_Add")) {
addEvent(getObj("Btn_Add"), "click", pageAdd);
addEvent(getObj("Btn_Add"), "click", handleRemoveClickEvent);
}
if (getObj("Btn_DoEdit")) {
addEvent(getObj("Btn_DoEdit"), "click", pageEdit);
addEvent(getObj("Btn_DoEdit"), "click", handleRemoveClickEvent);
}
if (getObj("Btn_Delete")) {
addEvent(getObj("Btn_Delete"), "click", pageDel);
addEvent(getObj("Btn_Delete"), "click", handleRemoveClickEvent);
}
if (getObj("Btn_Submit")) {
addEvent(getObj("Btn_Submit"), "click", pageSubmit);
addEvent(getObj("Btn_Submit"), "click", handleRemoveClickEvent);
}
if (getObj("Btn_ReFresh")) {
addEvent(getObj("Btn_ReFresh"), "click", pageReFresh);
addEvent(getObj("Btn_ReFresh"), "click", handleRemoveClickEvent);
}
if (getObj("Btn_Cancel")) {
addEvent(getObj("Btn_Cancel"), "click", pageCancel);
addEvent(getObj("Btn_Cancel"), "click", handleRemoveClickEvent);
}
if (getObj("Btn_Back")) {
addEvent(getObj("Btn_Back"), "click", pageBack);
addEvent(getObj("Btn_Back"), "click", handleRemoveClickEvent);
}
handleF5Refresh();
fnBreakWordAll({
word: 15,
re: '[\\w]'
});
framedispalay('myiframe');
getObj("myLayer").style.left = "580px";
getObj("myLayer").style.top = "137px";
pageLoad(getURL("pon\x5fnet\x5fsn\x5ft\x2egch"));
var newlocation = parseInt(getObj("myLayer").style.top) + 43;
getObj("myLayer").style.top = newlocation + "px";
getPageDisabledObj();
}
function menuDisp() {
menuURLGen();
menuUpdate();
}
function menuURLGen() {
for (var supId in meta_menu) {
meta_menu[supId]['URL'] = getURL(meta_menu[supId]['page']);
for (var midId in menu_items[supId]) {
menu_items[supId][midId]['URL'] = getURL(menu_items[supId][midId]['page']);
for (var subId in menu_subitems[supId][midId]) {
menu_subitems[supId][midId][subId]['URL'] = getURL(menu_subitems[supId][midId][subId]['page']);
}
}
}
}
function getURL() {
var ret = "getpage.gch?pid=1002&nextpage=";
var len = arguments.length;
if (0 != (len - 1) % 2) {
ShowErrorForCom(null, null, "arguments len err of getURL!");
return;
}
for (var i = 0; i < len; i++) {
if (i % 2 == 1) {
ret += "&" + arguments[i] + "=";
} else {
ret += arguments[i];
}
}
return ret;
}
function menuUpdate() {
TOPmenuUpdate();
LEFTmenuUpdate();
}
function TOPmenuUpdate() {
var TOPmenuText = "<ul><li><a class='big' id='mmstate'>状态</a></li>";
var TOPmenuNum = 0;
var left = 163;
var width = 107;
for (var supId in meta_menu) {
if (meta_menu.hasOwnProperty(supId)) {
TOPmenuNum = TOPmenuNum + 1;
}
}
if (TOPmenuNum != 0) {
width = 646 / TOPmenuNum + 2;
}
for (var supId in meta_menu) {
if (!meta_menu.hasOwnProperty(supId)) {
continue;
}
var styleVal;
var styleValtemp = "position:absolute;" + "z-index:1;" + "text-align:center;" + "height:25px;" + "padding-top:18px;" + "cursor:pointer;" + "background-color:#0058A8;";
styleValtemp += "left:" + left + "px;" + "width:" + width + "px;";
left = left + width - 1;
if (supId != selectSupId) {
styleVal = styleValtemp + "background-image: url(\"../img/button_bg_2.gif\");" + "background-repeat:repeat-x;" + "background-attachment:scroll;" + "background-position: left top;" + "color: #0058A8;";
} else {
styleVal = styleValtemp + "color: #FFFFFF;";
}
var TOPmenuTemp = "<li ><font id='" + supId + "' style='" + styleVal + "' οnclick=\"javascript:openLink('" + meta_menu[supId]['URL'] + "')\">" + meta_menu[supId]['langName'] + "</font></li>";
TOPmenuText += TOPmenuTemp;
}
TOPmenuText += "</ul>"
getObj("class1").innerHTML = TOPmenuText;
document.getElementById("mmstate").innerHTML = meta_menu[selectSupId]['langName'];
}
function LEFTmenuUpdate() {
var supId = selectSupId;
text = "<ul>" + "<li><a class='left'></a></li>" + "<li><span class='rightx text_content'><a name='top'></a>" + " | ";
for (var midId in menu_items[supId]) {
if (!menu_items[supId].hasOwnProperty(midId)) {
continue;
}
var stat = getMidMenuStat(supId, midId);
if (stat == "single") {
if (menu_items[supId][midId]['page'] == selectPage) {
text = text + "<span class='text_h2_s'>" + menu_items[supId][midId]['langName'] + "</span> | ";
} else {
text = text + "<a class='h2_link' id='" + midId + "' οnclick='javascript:openLink(\"" + menu_items[supId][midId]['URL'] + "\")'>" + menu_items[supId][midId]['langName'] + "</a> | ";
}
} else if (stat == "closed") {
text = text + "<a class='h2_link' id='" + midId + "' οnclick='javascript:openLink(\"" + menu_items[supId][midId]['URL'] + "\")'>" + menu_items[supId][midId]['langName'] + "</a> | ";
} else if (stat == "open") {
text = text + "<span class='text_h2_s'>" + menu_items[supId][midId]['langName'] + "</span> | ";
var textc3 = "<table class='class3_table' border='0' cellpadding='0' cellspacing='0'>";
for (var subId in menu_subitems[supId][midId]) {
if (!menu_subitems[supId][midId].hasOwnProperty(subId)) {
continue;
}
var titilflag = 0;
var titilTMP = "";
switch (subId) {
case ("ssmDHCPSer"):
{
titilTMP = "IPv4配置";
titilflag = 1;
break;
}
case ("ssmIPV6Ra"):
{
titilTMP = "<br>IPv6配置";
titilflag = 1;
break;
}
case ("ssmSIPPro"):
{
titilTMP = "宽带电话基本设置";
titilflag = 1;
break;
}
case ("ssmBasicCon"):
{
titilTMP = "<br>宽带电话高级设置";
titilflag = 1;
break;
}
default:
break;
}
if (titilflag == 1) {
textc3 = textc3 + "<tr class='class3_s'>" + "<td>" + "<font id='" + subId + "' style='color:rgb(44,80,109)'>" + titilTMP + " " + "</tr>";
}
if (menu_subitems[supId][midId][subId]['page'] == selectPage) {
textc3 = textc3 + "<tr class='class3_s'>" + "<td>" + "<font id='" + subId + "'>" + menu_subitems[supId][midId][subId]['langName'] + "<img src='img/push.gif'/></font></td>" + "</tr>";
} else {
textc3 = textc3 + "<tr class='class3'>" + "<td>" + "<a class='class3_space' id='" + subId + "' οnclick=\"javascript:openLink('" + menu_subitems[supId][midId][subId]['URL'] + "')\">" + menu_subitems[supId][midId][subId]['langName'] + "</a></td>" + "</tr>";
}
}
textc3 += "</table>";
getObj("h3_menu").innerHTML = textc3;
} + "</span></li>" + "</ul>";
getObj("menu0").innerHTML = text;
}
}
function getMidMenuStat(supId, midId) {
var len = 0;
for (var i in menu_subitems[supId][midId]) {
len++;
}
if (0 == len) {
return "single";
}
for (var subId in menu_subitems[supId][midId]) {
if (selectPage == menu_subitems[supId][midId][subId]['page']) {
return "open";
}
}
return "closed";
}
function addEvent(element, type, handler) {
if (element == null) {
return;
}
if (element.addEventListener) {
element.addEventListener(type, handler, false);
} else {
if (!handler.$$guid) {
handler.$$guid = addEvent.guid++;
}
if (!element.events) {
element.events = {};
}
var handlers = element.events[type];
if (!handlers) {
handlers = element.events[type] = {};
if (element["on" + type]) {
handlers[0] = element["on" + type];
}
}
handlers[handler.$$guid] = handler;
element["on" + type] = handleEvent;
}
};
addEvent.guid = 1;
function handleF5Refresh() {
function shieldRefresh(event) {
var event = event || window.event;
var keycode = event.keyCode || event.which || event.charCode;
if (keycode == 116) {
if (event.preventDefault) {
event.preventDefault();
} else {
event.keyCode = 0;
event.returnValue = false;
}
}
}
document.onkeydown = shieldRefresh;
top.window.onkeydown = shieldRefresh;
};
function fnBreakWordAll(o) {
var o = o || {};
var iWord = o.word || 13;
var iRe = o.re || '[a-zA-Z0-9]';
var bAll = o.all || false;
var sClassName = o.className || 'word-break-all';
var aEls = o.els || (function() {
var aEls = [],
aAllEls = document.getElementsByTagName('*'),
re = new RegExp('(?:^|\\s+)' + sClassName + '(?:\\s+|$)');
for (var i = 0, iLen = aAllEls.length; i < iLen; ++i) {
if (re.test(aAllEls[i].className)) {
aEls[aEls.length] = aAllEls[i];
}
}
return aEls;
})() || [];
var fnBreakWord = function(oEl) {
if (!oEl || oEl.nodeType !== 1) {
return false;
} else if (oEl.currentStyle && typeof(oEl.currentStyle.wordWrap) === 'string') {
breakWord = function(oEl) {
if (oEl.runtimeStyle) {
oEl.runtimeStyle.wordWrap = 'break-word';
}
return true;
};
return breakWord(oEl);
} else if (document.createTreeWalker) {
var trim = function(str) {
str = str.replace(/^\s\s*/, '');
var ws = /\s/;
var i = str.length;
while (ws.test(str.charAt(--i)));
return str.slice(0, i + 1);
};
breakWord = function(oEl) {
var dWalker = document.createTreeWalker(oEl, NodeFilter.SHOW_TEXT, null, false);
var node, s, c = String.fromCharCode('8203');
var re = new RegExp('(' + iRe + '{0,' + iWord + '})');
while (dWalker.nextNode()) {
node = dWalker.currentNode;
s = trim(node.nodeValue).split(re).join(c);
node.nodeValue = s;
}
return true;
};
return breakWord(oEl);
}
};
for (var i = 0, n = aEls.length; i < n; ++i) {
var sUa = navigator.userAgent,
sTn = aEls[i].tagName.toLowerCase();
if ((/Opera/).test(sUa) || (/Firefox/).test(sUa) || ((/KHTML/).test(sUa) && (sTn === 'td' || sTn === 'th')) || bAll) {
fnBreakWord(aEls[i]);
}
}
}
function framedispalay(id) {
if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE6.0") {} else {
jslDiDisplay(id);
}
}
function jslDiDisplay(id) {
var i;
var num = arguments.length;
if (num == 0) {
return;
}
for (i = 0; i < num; i++) {
getObj(arguments[i]).style.display = "none";
}
}
function pageLoad(url) {
getObj("fSubmit").action = url;
var errstr = getValue("IF_ERRORSTR");
var errpara = getValue("IF_ERRORPARAM");
OldProcessRet(errstr, errpara);
moveErrLayer(595, 93);
pageGetValue();
if (errstr == "SUCC") {
if (getValue("flag") == "1") {
msg = getmsg(808);
var isOK = window.confirm(msg);
if (isOK) {
jslDisable("Btn_Submit", "Btn_Cancel");
setValue("IF_ACTION", "devrestart");
setValue("flag", "2");
formSubmit();
} else {
setValue("flag", "0");
jslEnable("Btn_Submit", "Btn_Cancel");
}
} else if (getValue("flag") == "2") {
jslDisable("Btn_Submit", "Btn_Cancel");
msg = getmsg(807);
ShowNote("提示信息", msg);
AutoRelogin("restart");
}
}
jslDisable("Frm_Sn");
}
function OldProcessRet(errstr, errpara) {
if ("当前操作无效,请检查" == errstr && "SUCC" == errpara) {
errstr = "FAIL";
}
ProcessRet(errstr, errpara);
}
function ProcessRet(errstr, errpara) {
var errtype = getValue("IF_ERRORTYPE");
if (errstr != "SUCC") {
if (errpara != "SUCC") {
var param = document.getElementById("Fnt_" + errpara);
if (param == null) {
ShowErrorForCom(null, null, "当前操作无效,请检查配置参数。");
} else {
msg = "当前操作无效,请检查" + param.innerHTML + "是否合法。";
ShowErrorForCom("Frm_" + errpara, null, msg);
}
} else {
if (errstr == "FAIL") {
errstr = "当前操作无效,请检查配置参数。";
}
if ((errtype & 1) == 1) {
ShowNote("提示信息", errstr);
} else if ((errtype & 2) == 2) {
ShowErrorForCom(null, null, errstr);
} else if ((errtype & 4) == 4) {} else {
ShowErrorForCom(null, null, errstr);
}
}
}
}
function ShowNote(notetitle, msg) {
document.getElementById("errnote").innerHTML = notetitle;
document.getElementById("errmsg").innerHTML = msg;
document.getElementById("myLayer").style.visibility = "visible";
}
function moveErrLayer(left, top) {
var className = document.getElementById("myLayer").className;
if (className == "ZD") {
document.getElementById("myLayer").style.left = parseInt(left) + parseInt(350) + "px";
document.getElementById("myLayer").style.top = parseInt(top) + parseInt(50) + "px";
} else if (className == "HY") {
document.getElementById("myLayer").style.left = parseInt(left) + parseInt(110) + "px";
document.getElementById("myLayer").style.top = parseInt(top) + parseInt(140) + "px";
} else {
document.getElementById("myLayer").style.left = left + "px";
document.getElementById("myLayer").style.top = top + "px";
}
}
function pageGetValue() {
var UserRight = 1;
var gponSn = getValue("Sn");
gponSn = gponSn.toUpperCase();
setValue("Frm_Sn", gponSn);
if ((UserRight == 1) || (UserRight == 4)) {
jslEnable("Frm_Sn");
} else {
jslDisable("Frm_Sn", "Btn_Submit", "Btn_Cancel");
}
}
function jslEnable(id) {
var i = 0;
var num = arguments.length;
if (num == 0) {
return;
}
for (i = 0; i < num; i++) {
if (safeCtls.disabledCtls[arguments[i]] != undefined) {
if (getObj(arguments[i]).type == "button" || getObj(arguments[i]).type == "submit") {
getObj(arguments[i]).onclick = safeCtls.disabledCtls[arguments[i]];
} else {
safeCtls.disabledCtls[arguments[i]] = undefined;
}
}
getObj(arguments[i]).disabled = false;
}
}
function jslDisable(id) {
var i;
var num = arguments.length;
if (num == 0) {
return;
}
for (i = 0; i < num; i++) {
getObj(arguments[i]).disabled = true;
}
}
function AutoRelogin(type) {
var timeout;
if ((type == "restart") || (type == "upgconfig")) {
timeout = 3;
} else if (type == "restore") {
timeout = 3;
} else if (type == "upgversion") {
timeout = 5;
} else {
return;
}
setTimeout("jump()", timeout * 60 * 1000 + 5000);
}
function jump() {
top.location.href = "/";
}
function getPageDisabledObj() {
var inputArr = document.getElementsByTagName("input");
var selectArr = document.getElementsByTagName("select");
for (var i = 0; i < inputArr.length && inputArr[i]; i++) {
if (inputArr[i].disabled == true) {
if (inputArr[i].type == "checkbox") {
safeCtls.disabledCtls[inputArr[i].id] = inputArr[i].checked;
} else if (inputArr[i].type == "button" || inputArr[i].type == "submit") {
safeCtls.disabledCtls[inputArr[i].id] = inputArr[i].onclick;
inputArr[i].onclick = function() {};
} else {
safeCtls.disabledCtls[inputArr[i].id] = inputArr[i].value;
}
}
if (inputArr[i].style.display == "none") {
if (inputArr[i].type == "checkbox") {
safeCtls.displayCtls[inputArr[i].id] = inputArr[i].checked;
} else if (inputArr[i].type == "button" || inputArr[i].type == "submit") {
safeCtls.displayCtls[inputArr[i].id] = inputArr[i].onclick;
inputArr[i].onclick = function() {};
} else {
safeCtls.displayCtls[inputArr[i].id] = inputArr[i].value;
}
}
}
for (var i = 0; i < selectArr.length && selectArr[i]; i++) {
if (selectArr[i].disabled == true) {
safeCtls.disabledCtls[selectArr[i].id] = selectArr[i].value;
}
if (selectArr[i].style.display == "none") {
safeCtls.displayCtls[selectArr[i].id] = selectArr[i].value;
}
}
}
SN认证页面的完整HTML代码
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ZXHN F673AV9a</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<style>
...
</style>
<script language="javascript">
...
</script>
</head>
<!--增加iframe使错误提示框不被不被下拉菜单给遮盖-->
<body id="htmlBody">
<div id="myLayer" onmousedown="setinner('hidden')" style="position: absolute; width: 185px; height: 91px; z-index: 9; left: 595px; top: 136px; background: url("img/pop_up.gif") no-repeat; border: 1px none rgb(0, 0, 0); visibility: hidden;">
<iframe id="myiframe" style="position: absolute; width: 179px; height: 88px; border: 1px none rgb(0, 0, 0); z-index: -1; display: none;">
</iframe>
<div id="Layer3" style="position:absolute; width:30px; height:10px; z-index:11; left: 34px; top: 9px; font-size: 8pt;">
<table width="140" border="0">
<tbody><tr>
<td><font class="note" id="errnote"> 错误信息</font></td>
</tr>
</tbody></table>
</div>
<div id="Layer1" style="position:absolute; width:180px; height:45px; z-index:999; left: 2px; top: 28px;">
<table width="183" border="0" height="60">
<tbody><tr>
<td width="183" height="60px" valign="top"> <font id="errmsg" class="notecontent"></font></td>
</tr>
</tbody></table>
</div>
</div>
<!--help部分开始-->
<div id="alertFram" align="center" style="position:absolute; width:314px; height:auto; z-index:999; left: 380px; top: 9px; font-size: 9pt; display:none;">
<div style="width:220px; position: absolute;" align="left" id="dragAble" class="dragAble">
<div id="helpTextWrapper" style="position: relative">
<iframe id="helpiframe" style="position: absolute; width: 100%; display: block; border: 0px 0px; z-index: -1;">
</iframe>
<div>
<table style="width:220px;background-color:#fff; border:1px solid #34627E;" cellpadding="0" cellspacing="0">
<tbody><tr align="center">
<td style="height:26px;width:198px;background:url(img/1x26.gif) repeat-x;">
<font align="left" color="#0000"><b> 帮助</b></font>
</td>
<td style="width:22px;">
<img border="0" style="cursor:pointer;" onclick="hideHelp();" src="img/22x26.gif">
</td>
</tr>
<tr>
<td colspan="2" height="200px" width="220px" valign="top" align="left" class="word-break-all" style="padding:5px 0 0 10px;">终端设备使用SN方式向OLT注册。</td>
</tr>
</tbody></table>
</div>
</div>
</div>
</div>
<!--help部分结束-->
<div id="container">
<!--first line start-->
<div class="first_line">
<ul>
<li>
<a id="webTitleNote" class="b text_h2_s">型号:</a>
</li>
<li>
<a class="c text_h2_b">ZXHN F673AV9a</a>
</li>
<li>
<a class="exit text_h2_b" href="#" onclick="onClickLogout();return false;">退出</a>
</li>
</ul>
</div>
<!--first line end-->
<!--content部分开始-->
<div class="main_content" id="content" style="background:url(../img/content_bg.gif) repeat-y left top;">
<!--一、二、三级菜单开始-->
<!--一级菜单-->
<div class="class1" id="class1"><ul><li><a class="big" id="mmstate">网络</a></li><li><font id="mmStatus" style="position:absolute;z-index:1;text-align:center;height:25px;padding-top:18px;cursor:pointer;background-color:#0058A8;left:163px;width:94.28571428571429px;background-image: url("../img/button_bg_2.gif");background-repeat:repeat-x;background-attachment:scroll;background-position: left top;color: #0058A8;" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=status_dev_info_t.gch')">状态</font></li><li><font id="mmNet" style="position:absolute;z-index:1;text-align:center;height:25px;padding-top:18px;cursor:pointer;background-color:#0058A8;left:256.2857142857143px;width:94.28571428571429px;color: #FFFFFF;" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=net_ethwan_conf_t.gch')">网络</font></li><li><font id="mmSec" style="position:absolute;z-index:1;text-align:center;height:25px;padding-top:18px;cursor:pointer;background-color:#0058A8;left:349.57142857142856px;width:94.28571428571429px;background-image: url("../img/button_bg_2.gif");background-repeat:repeat-x;background-attachment:scroll;background-position: left top;color: #0058A8;" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=sec_url_filter_t.gch')">安全</font></li><li><font id="mmApp" style="position:absolute;z-index:1;text-align:center;height:25px;padding-top:18px;cursor:pointer;background-color:#0058A8;left:442.85714285714283px;width:94.28571428571429px;background-image: url("../img/button_bg_2.gif");background-repeat:repeat-x;background-attachment:scroll;background-position: left top;color: #0058A8;" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=app_ddns_conf_t.gch')">应用</font></li><li><font id="mmManager" style="position:absolute;z-index:1;text-align:center;height:25px;padding-top:18px;cursor:pointer;background-color:#0058A8;left:536.1428571428571px;width:94.28571428571429px;background-image: url("../img/button_bg_2.gif");background-repeat:repeat-x;background-attachment:scroll;background-position: left top;color: #0058A8;" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=manager_aduser_conf_t.gch')">管理</font></li><li><font id="mmDiag" style="position:absolute;z-index:1;text-align:center;height:25px;padding-top:18px;cursor:pointer;background-color:#0058A8;left:629.4285714285714px;width:94.28571428571429px;background-image: url("../img/button_bg_2.gif");background-repeat:repeat-x;background-attachment:scroll;background-position: left top;color: #0058A8;" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=manager_dev_ping_t.gch')">诊断</font></li><li><font id="mmHelp" style="position:absolute;z-index:1;text-align:center;height:25px;padding-top:18px;cursor:pointer;background-color:#0058A8;left:722.7142857142858px;width:94.28571428571429px;background-image: url("../img/button_bg_2.gif");background-repeat:repeat-x;background-attachment:scroll;background-position: left top;color: #0058A8;" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=help_t.gch')">帮助</font></li></ul></div>
<!--二级菜单-->
<div class="class2" id="class2">
<div class="class2_h2" id="menu0"><ul><li><a class="left"></a></li><li><span class="rightx text_content"><a name="top"></a> | <a class="h2_link" id="smWANConn" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=net_ethwan_conf_t.gch")">宽带设置</a> | <a class="h2_link" id="smBindConf" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=net_vlan_port_binding_t.gch")">绑定配置</a> | <a class="h2_link" id="smVPNConn" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=net_L2TPserver_t.gch")">VPN配置</a> | <a class="h2_link" id="smAddMgr" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=net_dhcp_dynamic_t.gch")">LAN侧地址配置</a> | <a class="h2_link" id="smQoS" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=cmc_net_qos_qosconf_t.gch")">QoS</a> | <a class="h2_link" id="smWLAN" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=net_wlan_conf1_t.gch")">WLAN网络配置</a> | <span class="text_h2_s">远程管理</span> | <a class="h2_link" id="smSNTP" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=net_sntp_conf_t.gch")">时间管理</a> | <a class="h2_link" id="smRoutMgr" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=app_rip_t.gch")">路由配置</a> | <a class="h2_link" id="smOLS" onclick="javascript:openLink("getpage.gch?pid=1002&nextpage=net_optical_offset_t.gch")">介质参数</a> | </span></li></ul></div>
<div style="height:14px;"></div>
<div class="shadow">
<ul>
<li><a class="s1" style="background:url(../img/left_bg.gif) repeat left top;"></a></li>
<li><a class="s2" style="background:url(../img/jiao_bg.gif) no-repeat left top;"></a></li>
<li><a class="s3" style="background:url(../img/up_bg.gif) repeat-x left top;"></a></li>
</ul>
</div>
</div>
<!--帮助按钮开始-->
<div class="help">
<ul>
<input id="help_info" name="help_info" type="button" onclick="showHelp('终端设备使用SN方式向OLT注册。', '帮助')" class="help_button" value="帮助">
</ul>
</div>
<!--帮助按钮结束-->
<!--内容开始-->
<!--导航条开始-->
<form name="flogout" id="flogout" method="post" onsubmit="return false;" action="/" target="_top">
<input type="hidden" name="logout" id="logout" value="">
<input type="hidden" name="timeout" id="timeout" value="">
<input type="hidden" name="timeoutRandomNum" id="timeoutRandomNum" value="">
<input id="_SESSION_TOKEN" name="_SESSION_TOKEN" type="hidden" value="3JLsdHDxIuu5x1db00cOdiZc"></form>
<form name="ftonote" id="ftonote" method="post" onsubmit="return false;" action="/timeout_t.gch" target="_top">
<input type="hidden" name="logout" id="logout" value="1">
<input id="_SESSION_TOKEN" name="_SESSION_TOKEN" type="hidden" value="3JLsdHDxIuu5x1db00cOdiZc"></form>
<!--导航条结束-->
<div class="main_content text_content">
<!--三级菜单开始-->
<div class="class3_div" id="h3_menu"><table class="class3_table" border="0" cellpadding="0" cellspacing="0"><tbody><tr class="class3"><td><a class="class3_space" id="ssmTR069Basic" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=net_tr069_basic_t.gch')">RMS服务器</a></td></tr><tr class="class3"><td><a class="class3_space" id="ssmLOID" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=pon_net_ponloid_t.gch')">LOID认证</a></td></tr><tr class="class3"><td><a class="class3_space" id="ssmPWD" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=pon_net_ponpwd_t.gch')">PASSWORD认证</a></td></tr><tr class="class3_s"><td><font id="ssmSN">SN认证<img src="img/push.gif"></font></td></tr><tr class="class3"><td><a class="class3_space" id="ssmCF" onclick="javascript:openLink('getpage.gch?pid=1002&nextpage=net_tr069_cafile_t.gch')">上传CA证书</a></td></tr></tbody></table></div>
<div id="e8_div1">
<form name="fSubmit" id="fSubmit" method="POST" action="getpage.gch?pid=1002&nextpage=pon_net_sn_t.gch">
<input type="hidden" name="IF_ERRORSTR" id="IF_ERRORSTR" value="SUCC">
<script language="javascript">Transfer_meaning('IF_ERRORSTR','SUCC');</script>
<input type="hidden" name="IF_ERRORPARAM" id="IF_ERRORPARAM" value="SUCC">
<script language="javascript">Transfer_meaning('IF_ERRORPARAM','NULL');</script>
<input type="hidden" name="IF_ERRORTYPE" id="IF_ERRORTYPE" value="-1">
<script language="javascript">Transfer_meaning('IF_ERRORTYPE','\x2d1');</script>
<input type="hidden" name="Sn" id="Sn" value="ZTExxxxxxxx">
<script language="javascript">Transfer_meaning('Sn','ZTExxxxxxxx');</script>
<input type="hidden" name="Pwd" id="Pwd" value="">
<script language="javascript">Transfer_meaning('Pwd','');</script>
<script language="javascript">Transfer_meaning('IF_ERRORSTR','SUCC');</script>
<script language="javascript">Transfer_meaning('IF_ERRORPARAM','SUCC');</script>
<script language="javascript">Transfer_meaning('IF_ERRORTYPE','\x2d1');</script>
<input type="hidden" name="IF_ACTION" id="IF_ACTION" value="">
<script language="javascript">Transfer_meaning('IF_ACTION','');</script>
<input type="hidden" name="IF_INDEX" id="IF_INDEX" value="0">
<script language="javascript">Transfer_meaning('IF_INDEX','0');</script>
<input type="hidden" name="flag" id="flag" value="NULL">
<script language="javascript">Transfer_meaning('flag','NULL');</script>
<input id="_SESSION_TOKEN" name="_SESSION_TOKEN" type="hidden" value="3JLsdHDxIuu5x1db00cOdiZc"></form>
<script language="javascript">...</script>
<div class="space_0">
<table class="table" width="450px" border="0" style="padding-left:100px;">
<tbody><tr>
<td valign="top" style="width:30px;"><img src="img/info.gif"></td>
<td height="18" align="left" style="padding-left:10px;">必须在设备重启后生效。</td>
</tr>
</tbody></table>
</div>
<div class="space_0">
<table id="OnuPwdConf" class="table" width="450px" border="0">
<tbody><tr>
<td class="td1"><font id="Fnt_Sn">SN认证</font></td>
<td class="td2"><input name="Frm_Sn" id="Frm_Sn" type="text" value="" class="inputId" disabled=""></td>
</tr>
</tbody></table>
</div>
<div class="div4"></div>
</div>
<!--内容结束-->
</div>
<div class="bottom_div" id="bottom"><table class="bottom_table" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="bottom_td1"></td><td class="bottom_td2"><input name="Submit" type="button" id="Btn_Submit" class="button" value=" 确 定 "> <input name="Submit" type="button" id="Btn_Cancel" class="button" value=" 取 消 "> </td><td class="bottom_td3"></td></tr></tbody></table></div>
<!--content部分结束-->
<!--bottom部分开始-->
<div id="bottomx"></div>
</div>
<!--bottom部分结束-->
<input type="hidden" id="IF_UPLOADING" name="IF_UPLOADING" value="N/A">
<script language="javascript">
...
</script>
</div></body></html>
框架页面的完整HTML代码
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ZXHN F673AV9a</title>
<style>
* {
margin: 0 0 0 0;
padding: 0;
}
html {min-height:101%;}
body {
background-color:#fff;
}
</style>
<script type="text/javascript">
...
</script><script type="text/javascript" src="/js/crypto-js.min.js"></script><script type="text/javascript" src="/js/jsencrypt.min.js"></script><script type="text/javascript" src="/js/code.js"></script><style type="text/css">...</style></head>
<body align="center">
<div align="center" style="margin:0 auto;">
<table width="778px" border="0">
<tbody><tr>
<td>
<iframe width="808px" height="67px" src="top.gch" name="topFrame" scrolling="no" frameborder="0" id="topFrame"></iframe>
<iframe width="808px" src="template.gch" name="mainFrame" id="mainFrame" scrolling="no" frameborder="0" onload="this.height=512" height="568"></iframe>
</td>
</tr>
</tbody></table>
</div>
<div style="position: fixed; inset: 0px; z-index: 9999; display: none; align-items: center; justify-content: center;"></div><doubao-ai-csui id="doubao-ai-assistant" aria-label="flow-ai-assistant" data-host-id="1c8629a0-ed9d-4b60-9103-1c9732818b8d" class="flow-ai-select-bar-enabled" aria-description="flow-ai-select-bar-enabled"></doubao-ai-csui></body></html>