下面为载入页面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>load的用法</title>
<script type="text/javascript" src="jquery-1.1.3.pack.js"></script>
<script type="text/javascript">
$(function() {
$("#feeds").load("demo1.html",function() { alert("load is done");}
);
});
</script> </head>
<body>
<div id="feeds"></div>
</body>
</html>
下面为被载入页面:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>hello world</title>
<script type="text/javascript" src="http://www.cssrain.cn/demo/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").click(function(){alert("hello world");});
});
</script>
</head> <body>
<p>$(document)是获取整个网页文档对象,$("p")是获取所有的段落标签. ---单击我</p>
<hr/>
<p>我也是一个段落文本,单击我也弹出hello world .---单击我</p>
</body>
</html>
用IE打开载入页面出现乱码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>load的用法</title>
<script type="text/javascript" src="jquery-1.1.3.pack.js"></script>
<script type="text/javascript">
$(function() {
$("#feeds").load("demo1.html",function() { alert("load is done");}
);
});
</script> </head>
<body>
<div id="feeds"></div>
</body>
</html>
下面为被载入页面:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>hello world</title>
<script type="text/javascript" src="http://www.cssrain.cn/demo/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").click(function(){alert("hello world");});
});
</script>
</head> <body>
<p>$(document)是获取整个网页文档对象,$("p")是获取所有的段落标签. ---单击我</p>
<hr/>
<p>我也是一个段落文本,单击我也弹出hello world .---单击我</p>
</body>
</html>
用IE打开载入页面出现乱码
<script src="jquery-1.5.1.min.js" type="text/javascript" ></script> $('#bAj3').bind('click',function(){
$("#fad").load('b.html',function(msg){
alert(msg);
});
});
<div id='fad'></div>
<button id="bAj3">load</button> b.html 片段<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<title>jquery_ch01</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<body>
这是一个测试 看是否乱码
</body>
</html>看下是否是jquery版本的问题