【HTML/JS】利用JQuery的load函数动态加载其它页面的内容的实现代码
来源:互联网 发布:java生成8位邀请码 编辑:程序博客网 时间:2024/06/02 02:25
http://www.jb51.net/article/25621.htm
利用JQuery的load函数动态加载别的页面的代码,方便实时获取别的页面的内容。
在线演示:http://demo.jb51.net/js/JQueryload/index.htm
全部代码
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>JQuery - Load</title>
<link rel="stylesheet" media="all" type="text/css" href="../CSS/myStyle.css" />
<script type="text/javascript" src="http://demo.jb51.net/jslib/jquery/jquery-1.3.2.min.js"></script>
<style type="text/css">
#header {
margin-bottom: 1em;
padding-bottom: 1em;
border-bottom: 1px solid #eee;
}
.buttonListArea {
float: left;
width: 150px;
padding-right: 10px;
border-right: 1px solid #eee;
margin-right: 10px;
}
.buttonArea {
margin: 10px;
padding-bottom:20px;
}
#load_content {
float: left;
width: 550px;
text-align:center;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#btnLoad1.button').click(function() {
$('#load_content').load('loadContent1.htm');
});
$('#btnLoad2.button').click(function() {
$('#load_content').load('loadContent2.htm');
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="container">
<div id="header">
<h2>JQuery Load Example</h2>
</div>
<div class="buttonListArea">
<div class="buttonArea">
<div class="button" id="btnLoad1">Load 1</div>
</div>
<div class="buttonArea">
<div class="button" id="btnLoad2">Load 2</div>
</div>
</div>
<div id="load_content">
<h2>这是要被加载的区域</h2>
</div>
</div>
</form>
</body>
</html>
loadContent1.htm
jb51.net
loadContent2.htm
sc.jb51.net
全部代码
复制代码代码如下:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>JQuery - Load</title>
<link rel="stylesheet" media="all" type="text/css" href="../CSS/myStyle.css" />
<script type="text/javascript" src="http://demo.jb51.net/jslib/jquery/jquery-1.3.2.min.js"></script>
<style type="text/css">
#header {
margin-bottom: 1em;
padding-bottom: 1em;
border-bottom: 1px solid #eee;
}
.buttonListArea {
float: left;
width: 150px;
padding-right: 10px;
border-right: 1px solid #eee;
margin-right: 10px;
}
.buttonArea {
margin: 10px;
padding-bottom:20px;
}
#load_content {
float: left;
width: 550px;
text-align:center;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#btnLoad1.button').click(function() {
$('#load_content').load('loadContent1.htm');
});
$('#btnLoad2.button').click(function() {
$('#load_content').load('loadContent2.htm');
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="container">
<div id="header">
<h2>JQuery Load Example</h2>
</div>
<div class="buttonListArea">
<div class="buttonArea">
<div class="button" id="btnLoad1">Load 1</div>
</div>
<div class="buttonArea">
<div class="button" id="btnLoad2">Load 2</div>
</div>
</div>
<div id="load_content">
<h2>这是要被加载的区域</h2>
</div>
</div>
</form>
</body>
</html>
loadContent1.htm
复制代码代码如下:
jb51.net
loadContent2.htm
复制代码代码如下:
sc.jb51.net
0 0
- 【HTML/JS】利用JQuery的load函数动态加载其它页面的内容的实现代码
- [HTML/JS]利用JQuery的load函数动态加载其它页面的内容的实现代码代替Ifram
- 利用Jquery的load函数实现页面的动态加载
- 利用JQuery的load函数动态加载页面 以及jQuery动态加载页面和请求所返回的数据
- jquery的load函数实现页面的局部加载
- 利用jQuery.html()实现夸浏览器的动态内容更新
- jQuery实现页面滚动时动态加载内容的方法
- jQuery的load方法设计动态加载及解决被加载页面js
- html动态加载内容的js事件
- jquery的load方法为元素动态加载内容
- $.load加载动态页面ie失效,js失效的问题
- JQuery实现页面随滚动条滚动而动态加载内容的效果
- JQuery实现页面随滚动条滚动而动态加载内容的效果
- 【转】JQuery实现页面随滚动条滚动而动态加载内容的效果
- JQuery实现页面随滚动条滚动而动态加载内容的效果
- JQuery实现页面随滚动条滚动而动态加载内容的效果
- JQuery实现页面随滚动条滚动而动态加载内容的效果
- html实现跳转到其它的页面
- ping通但上不了网的一个解决方法
- 薄慕明谈创新
- Objective-C语法之代码块(block)的使用
- android training Supporting Different Screens
- smartSvn ignore配置
- 【HTML/JS】利用JQuery的load函数动态加载其它页面的内容的实现代码
- 全局变量和静态变量分析
- 关于SQL server 2012无法打开物理文件“某某某”,操作系统错误5 :"(拒绝访问)"。(Microsoft SQL Server,错误 5120)
- 解决 HP Deskjet 1000 打印字体模糊
- Python的ABC模块
- 密码发生器
- 信任在哪里?
- Android HandlerThread 源码分析
- C5_二维数组