Jquery 问题,代码很短,求解 本帖最后由 stagezm 于 2011-08-04 04:17:41 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 作用域的问题<!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=utf-8" /><title>Jquery Testing</title><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> </head><body><ul style="list-style:none"></ul><script type="text/jscript">var _datas = new Array('a','b','c');for(i=0;i<_datas.length;i++) { var obj = $('<li style="margin:20px 0;width:70px"><img/></li>').clone(); obj.find('img').attr('src','http://www.google.com.hk//intl/zh-CN/images/logo_cn.png'); obj.appendTo('ul'); (function(i){ obj.bind('mouseover',function(){alert(_datas[i])}); })(i); }</script></body></html> obj.bind('mouseover' , {"v": _datas[i] } ,function(e){alert(e.data.v)});jquery api中有。为什么是undefined 看JS 的闭包 谁能给我个旋转木马代码 用js或者jquery写 的 关于javascript中的拖放,疑惑! 谁能帮我看下这个放大镜效果在IE7下为什么很慢.IE6都正常 文本框清空问题 一个窗口刷新的问题 请问如何做自动提交页面? 怎样输入出原有的数据库内格式! 又是javascript在ie和netscript 中的区别……, 紧急! 能否访问不同框架中的图层??一定给分!! vue和iframe的问题 求一个你们在用的,效果很好的,兼容all的,简单的图片延迟加载JS代码 谁能告诉我我这哪里有错啊
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Jquery Testing</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> </head><body>
<ul style="list-style:none"></ul>
<script type="text/jscript">
var _datas = new Array('a','b','c');
for(i=0;i<_datas.length;i++) {
var obj = $('<li style="margin:20px 0;width:70px"><img/></li>').clone();
obj.find('img').attr('src','http://www.google.com.hk//intl/zh-CN/images/logo_cn.png');
obj.appendTo('ul');
(function(i){
obj.bind('mouseover',function(){alert(_datas[i])});
})(i);
}
</script>
</body>
</html>