100分求jquery绑定ajax代码!先谢谢了啊!
我想要的是当Layer1有变换时,执行jquery动画!代码如下?怎么才能合2为1呢?
<script type="text/javascript">function ajax1()
{
var xmlHttp;
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.getElementById("Layer1").innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("GET","test1.asp?action=b",true);
xmlHttp.send(null);
}
//下面是jquery
<script type="text/javascript" >
$('#Layer1').animate({left:100,top:150}, {duration: 1300});
</script>
我想要的是当Layer1有变换时,执行jquery动画!代码如下?怎么才能合2为1呢?
<script type="text/javascript">function ajax1()
{
var xmlHttp;
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.getElementById("Layer1").innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("GET","test1.asp?action=b",true);
xmlHttp.send(null);
}
//下面是jquery
<script type="text/javascript" >
$('#Layer1').animate({left:100,top:150}, {duration: 1300});
</script>
Layer1有变换是什么意思?ajax的目的是异步和后台数据交互.和你这个动画有什么关系?
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
$().ready(function(){
$.get("test1.asp",{action:'b'},function(data){
$('#Layer1').html(data).animate({left:100,top:150}, {duration: 1300});
});
})
</script>
<div id="Layer1" style="position:absolute;left:0;top:0">xx</div>
http://topic.csdn.net/u/20100222/09/1e9ab2ef-a8d1-4b2e-9298-393f24ba74ce.html?80529