由于有注释,所以不打算作太多说明,甚至不加说明。
首先是Apq.aspx
该页面主要功能是作为框架顶层window,但是它是可选的。并不一定需要它。
随后的见:
Config
<!--
Apq$main
-->
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>


<
script
type
="text/jscript"
>
window.Apq$main = true; // 申明为主框架页
</
script
>

<
script
src
="Script/_Config.js"
type
="text/jscript"
></
script
>


<
script
type
="text/jscript"
>
/// 更新标题
function title_update()

{
try
{
var main = document.getElementById( "main" );
// 这里不能是以下语句
// document.title = main.document.title;
setTimeout( "document.title = main.document.title", 0 );
}catch(e)
{}
}
function window_onload()

{
// 取消本处理
window.detachEvent("onload",window_onload);
Apq_Init();
var main = document.getElementById( "main" );
main.style.posHeight = document.body.offsetHeight - 24;
main.attachEvent("onload",title_update);
main.attachEvent("onresize",main_onresize);
// 打开起始页面
main.src = Apq$Config.Home;
}
window.attachEvent("onload",window_onload);
function main_onresize()

{
var main = document.getElementById( "main" );
main.style.posHeight = document.body.offsetHeight - 24;
}
</
script
>

<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
></
title
>
</
head
>
<
body
style
="margin: 0"
scroll
="no"
>
<
form
id
="form1"
runat
="server"
>
<
iframe
id
="main"
width
="100%"
frameborder
="no"
></
iframe
>
</
form
>
</
body
>
</
html
>
本文介绍了名为Apq的自写前端框架,该框架的最大特点是能够与其他框架无缝结合使用,并详细展示了Apq框架的部分核心代码及其实现原理。
259

被折叠的 条评论
为什么被折叠?



