功能介绍:
1、全站生成html(可选)
可减轻服务器负载
源代码在线查看: smartnav.js
var snSrc;
if (window.__smartNav == null)
{
window.__smartNav = new Object();
window.__smartNav.update = function()
{
var sn = window.__smartNav;
var fd;
document.detachEvent("onstop", sn.stopHif);
sn.inPost = false;
try { fd = frames["__hifSmartNav"].document; } catch (e) {return;}
var fdr = fd.getElementsByTagName("asp_smartnav_rdir");
if (fdr.length > 0)
{
if (sn.sHif == null)
{
sn.sHif = document.createElement("IFRAME");
sn.sHif.name = "__hifSmartNav";
sn.sHif.style.display = "none";
sn.sHif.src = snSrc;
}
try {window.location = fdr[0].url;} catch (e) {};
return;
}
var fdurl = fd.location.href;
index = fdurl.indexOf(snSrc);
if ((index != -1 && index == fdurl.length-snSrc.length)
|| fdurl == "about:blank")
return;
var fdurlb = fdurl.split("?")[0];
if (document.location.href.indexOf(fdurlb) < 0)
{
document.location.href=fdurl;
return;
}
if (sn.sHif != null)
{
sn.sHif.removeNode(true);
sn.sHif = null;
}
var hdm = document.getElementsByTagName("head")[0];
var hk = hdm.childNodes;
var tt = null;
for (var i = hk.length - 1; i>= 0; i--)
{
if (hk[i].tagName == "TITLE")
{
tt = hk[i].outerHTML;
continue;
}
if (hk[i].tagName != "BASEFONT" || hk[i].innerHTML.length == 0)
hdm.removeChild(hdm.childNodes[i]);
}
var kids = fd.getElementsByTagName("head")[0].childNodes;
for (var i = 0; i < kids.length; i++)
{
var tn = kids[i].tagName;
var k = document.createElement(tn);
k.id = kids[i].id;
k.mergeAttributes(kids[i]);
switch(tn)
{
case "TITLE":
if (tt == kids[i].outerHTML)
continue;
k.innerText = kids[i].text;
hdm.insertAdjacentElement("afterbegin", k);
continue;
case "BASEFONT" :
if (kids[i].innerHTML.length > 0)
continue;
break;
default:
var o = document.createElement("BODY");
o.innerHTML = "" + kids[i].outerHTML + "";
k = o.firstChild;
break;
}
hdm.appendChild(k);
}
document.body.clearAttributes();
document.body.id = fd.body.id;
document.body.mergeAttributes(fd.body);
var newBodyLoad = fd.body.onload;
if (newBodyLoad != null)
document.body.onload = newBodyLoad;
var s = "" + fd.body.innerHTML + "";
if (sn.hif != null)
{
var hifP = sn.hif.parentElement;
if (hifP != null)
sn.sHif=hifP.removeChild(sn.hif);
}
document.body.innerHTML = s;
var sc = document.scripts;
for (var i = 0; i < sc.length; i++)
{
sc[i].text = sc[i].text;
}
sn.hif = document.all("__hifSmartNav");
if (sn.hif != null)
{
var hif = sn.hif;
sn.hifName = "__hifSmartNav" + (new Date()).getTime();
frames["__hifSmartNav"].name = sn.hifName;
sn.hifDoc = hif.contentWindow.document;
if (sn.ie5)
hif.parentElement.removeChild(hif);
window.setTimeout(sn.restoreFocus,0);
}
if (typeof(window.onload) == "string")
{
try { eval(window.onload) } catch (e) {};
}
else if (window.onload != null)
{
try { window.onload() } catch (e) {};
}
sn.attachForm();
};
window.__smartNav.restoreFocus = function()
{
if (window.__smartNav.inPost == true) return;
var curAe = document.activeElement;
var sAeId = window.__smartNav.ae;
if (sAeId==null || curAe!=null && (curAe.id==sAeId||curAe.name==sAeId))
return;
var ae = document.all(sAeId);
if (ae == null) return;
try { ae.focus(); } catch(e){};
}
window.__smartNav.saveHistory = function()
{
if (window.__smartNav.hif != null)
window.__smartNav.hif.removeNode();
if ( window.__smartNav.sHif != null
&& document.all[window.__smartNav.siHif] != null)
document.all[window.__smartNav.siHif].insertAdjacentElement(
"BeforeBegin", window.__smartNav.sHif);
}
window.__smartNav.stopHif = function()
{
document.detachEvent("onstop", window.__smartNav.stopHif);
var sn = window.__smartNav;
if (sn.hifDoc == null && sn.hif != null)
{
try {sn.hifDoc = sn.hif.contentWindow.document;}
catch(e){sn.hifDoc=null}
}
if (sn.hifDoc != null)
{
try {sn.hifDoc.execCommand("stop");} catch (e){}
}
}
window.__smartNav.init = function()
{
var sn = window.__smartNav;
document.detachEvent("onstop", sn.stopHif);
document.attachEvent("onstop", sn.stopHif);
try { if (window.event.returnValue == false) return; } catch(e) {}
sn.inPost = true;
if (document.activeElement != null)
{
var ae = document.activeElement.id;
if (ae.length == 0)
ae = document.activeElement.name;
sn.ae = ae;
}
else
sn.ae = null;
try {document.selection.empty();} catch (e) {}
if (sn.hif == null)
{
sn.hif = document.all("__hifSmartNav");
sn.hifDoc = sn.hif.contentWindow.document;
}
if (sn.hifDoc != null)
try {sn.hifDoc.designMode = "On";}catch(e){};
if (sn.hif.parentElement == null)
document.body.appendChild(sn.hif);
var hif = sn.hif;
hif.detachEvent("onload", sn.update);
hif.attachEvent("onload", sn.update);
window.__smartNav.fInit = true;
};
window.__smartNav.submit = function()
{
window.__smartNav.fInit = false;
try { window.__smartNav.init(); } catch(e) {}
if (window.__smartNav.fInit)
window.__smartNav.form._submit();
};
window.__smartNav.attachForm = function()
{
var cf = document.forms;
for (var i=0; i {
if (cf[i].__smartNavEnabled != null)
{
window.__smartNav.form = cf[i];
break;
}
}
var snfm = window.__smartNav.form;
if (snfm == null) return false;
var sft = snfm.target;
if (sft.length != 0 && sft.indexOf("__hifSmartNav") != 0) return false;
var sfc = snfm.action.split("?")[0];
var url = window.location.href.split("?")[0];
if (url.charAt(url.length-1) != '/' && url.lastIndexOf(sfc) + sfc.length != url.length) return false;
if (snfm.__formAttached == true) return true;
snfm.__formAttached = true;
snfm.attachEvent("onsubmit", window.__smartNav.init);
snfm._submit = snfm.submit;
snfm.submit = window.__smartNav.submit;
snfm.target = window.__smartNav.hifName;
return true;
};
window.__smartNav.hifName = "__hifSmartNav" + (new Date()).getTime();
window.__smartNav.ie5 = navigator.appVersion.indexOf("MSIE 5") > 0;
var rc = window.__smartNav.attachForm();
var hif = document.all("__hifSmartNav");
if (snSrc == null) {
snSrc = hif.src;
}
if (rc)
{
var fsn = frames["__hifSmartNav"];
fsn.name = window.__smartNav.hifName;
window.__smartNav.siHif = hif.sourceIndex;
try {
if (fsn.document.location != snSrc)
{
fsn.document.designMode = "On";
hif.attachEvent("onload",window.__smartNav.update);
window.__smartNav.hif = hif;
}
}
catch (e) { window.__smartNav.hif = hif; }
window.attachEvent("onbeforeunload", window.__smartNav.saveHistory);
}
else
window.__smartNav = null;
}
|
相关资源 |
|
-
功能介绍:
1、全站生成html(可选)
可减轻服务器负载
-
雷客图ASP站长安全助手
功能:
1、ASP木马查找(能够查出现在几乎所有的ASP木马)
2、文件篡改检查
3、可疑文件搜索
4、Access数据库保护
5、记录入侵者信息
-
无线技术学习笔记:一个最基本的无线网络需要
1、中心接入点(无线路由器)
2、“传输介质”(红外线或无线电波)
3、接收器(无线网卡)
-
学校网站由一个文章发布系统、公告系统、计数系统三个部分组成。
1、自动生成HTM文件
-
创易企业网站系统V2008 SEO增强版是基于asp+access开发, 快速稳定,功能更强大,全站生成html。
创易企业网站系统后台主要功能如下:
修正后台删除产品错误
修正前台
-
SK信息采集2.0功能介绍:
1.可针对任何静态网页,动态网页进行采集。包括htm,html,shtml,ASP,ASPX,JSP,PHP等。
2.增加自定文件采集.用户可采集网页中的所有文件.
-
全球商务网站系统介绍
GLOBALEC.COM.CN[生成HTML版]
系统概述:
软件名称:全球商务网站系统
当前版本:V1.0
最新版本:V1.1
运行环境:WINNT+(IIS)
-
功能介绍:
一、会员功能模块
1、站内短信发布(设计中)
2、书架收藏夹
3、发表评论(功能不完善)
4、申请作家(与添书员整合)
5、申请添书员(与作家整合)
6、申请更新员
|