使用JavaScript或jQuery动态加载div页面中的html页面。使用jquery动态加载div页面中的html页面
<html>
<head>
<title>Untitled Document</title>
</head>
<script type="text/javascript">
$(document).ready(function(){
$('#btn').click(function(){
$('#div_content').html('C:/xampp/htdocs/ex1.html');
});
});
</script>
<body>
<input type="button" id="btn" value="Load" />
<div id="d_content">
</div>
</body>
</html>
但它不工作..
你的Web服务器上测试这个? – Daedalus 2013-03-10 07:51:13
我测试了。浏览器显示以下错误“Uncaught SyntaxError:Unexpected token {” – Hari 2013-03-10 08:15:34
请向我们展示您的所有代码。上面的块不是问题。 – Daedalus 2013-03-10 09:10:59