【发布时间】:2010-12-29 10:07:06
【问题描述】:
请问可以用jquery ajax加载方法来加载图片吗,下面是我的代码,失败了,谁能改正?
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("div").ajaxStart(function(){
$(this).html("<img src='http://www.w3schools.com/jquery/demo_wait.gif' />");
});
$("button").click(function(){
$("div").load("http://www.google.com/images/logos/ps_logo2.png/");
});
});
</script>
</head>
<body>
<div><h2>Let AJAX change this text</h2></div>
<button>Change Content</button>
</body>
</html>
【问题讨论】:
标签: javascript jquery image methods load