Javascript 使用html页面加载Div包含框架
我想通过javascript加载一个html页面,该页面在一个div中包含2个框架。 我在div中加载html资源的代码是Javascript 使用html页面加载Div包含框架,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我想通过javascript加载一个html页面,该页面在一个div中包含2个框架。 我在div中加载html资源的代码是 Util.importResource("my_div_id", 'docs/admin/index.html'); 用于在div中加载资源的函数 Util={ importResource: function(divId, resourcePath, appender) { $("div#" + divId).load(resourcePath, funct
Util.importResource("my_div_id", 'docs/admin/index.html');
用于在div中加载资源的函数
Util={
importResource: function(divId, resourcePath, appender) {
$("div#" + divId).load(resourcePath, function(resp, stat, req) {
if(req.status <= 0 || req.status >= 400) {
window.location.reload();
return;
}
if (typeof(appender) != "undefined" && appender != null)
{
resp += appender;
$("div#" + divId).append(appender);
}
});
},
Util={
importResource:函数(divId、resourcePath、appender){
$(“div#“+divId).load(资源路径、函数(resp、stat、req){
如果(请求状态=400){
window.location.reload();
返回;
}
if(typeof(appender)!=“undefined”&&appender!=null)
{
resp+=追加器;
$(“div#“+divId).append(appender);
}
});
},
}
但该特定页面不会显示在divrest普通html页面中。
我的Html页面看起来像
<html>
<head>
<title>asd</title>
</head>
<frameset cols="20%,*" style="border:0px solid #000000; background-color:#ffffff;" frameborder="1">
<frame name="toclist" title="content" src="toc.html" scrolling="auto"></frame>
<frame name="bsscright" title="page" src="hr/title_page.html" scrolling="auto"></frame>
</frameset>
</html>
自闭症
有人能帮我摆脱这一切吗 我想您需要追加
resp+appender
....
if (typeof(appender) != "undefined" && appender != null)
{
resp += appender;
$("div#" + divId).append(resp );
}
else{
$("div#" + divId).append(resp );
}
.....