|

https://pan.baidu.com/s/1oAPlQPtdEBZCINHqYVCEQw
提取码:t6p3 8-奇易游览器填表之JavaScriptch穿透框架代码分析
function x_f(str)
{
var arr = str.split("|");
var doc = document;
for(var index=0;index<arr.length;index++)
{
var divs = doc.getElementsByTagName("frame");
if(divs.length<=0){divs = doc.getElementsByTagName("iframe");}
var text = arr[index];
//console.log("查找指定标志符框架:"+text+",框架数量:"+divs.length);
if(parseInt(text) == text){doc = divs[parseInt(text)].contentWindow.document;continue;}
for(var i=0;i<divs.length;i++)
{
if(divs.id == text){doc = divs.contentWindow.document;console.log("符合的id:"+text+"|"+divs.id);continue;}
if(divs.getAttribute("name") == text){doc = divs.contentWindow.document; console.log("符合的name:"+text+"|"+divs.getAttribute("name"));continue;}
if(divs.className == text){doc = divs.contentWindow.document;continue;}
if(divs.innerText == text){doc = divs.contentWindow.document;continue;}
if(divs.innerHTML == text){doc = divs.contentWindow.document;continue;}
if(divs.value == text){doc = divs.contentWindow.document;continue;}
if(divs.href == text){doc = divs.contentWindow.document;continue;}
}
}
return doc;
}
|
|