$("#frmTest input:submit").addClass("bg_red");
2015-06-17
$("#frmV").ajaxForm(options);
除了jqury.js,事实上还调用了http://www.imooc.com/data/jquery.form.js这个插件,看源码有关option的部分如下:
options = $.extend({
url: this.attr('action') || window.location.toString(),
type: this.attr('method') || 'GET'
}, options || {});
除了jqury.js,事实上还调用了http://www.imooc.com/data/jquery.form.js这个插件,看源码有关option的部分如下:
options = $.extend({
url: this.attr('action') || window.location.toString(),
type: this.attr('method') || 'GET'
}, options || {});
2015-06-17
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
$(function(){
var st=[{"name":"f","fuck":"d"},
{"name":"q","fuck":"q"}];
$.each(st,function(index){
$("ul").append("<li>name:"+st[index].name +"<br>"+"fuck:"+st[index].fuck+"</li>")
});
})
$(function(){
var st=[{"name":"f","fuck":"d"},
{"name":"q","fuck":"q"}];
$.each(st,function(index){
$("ul").append("<li>name:"+st[index].name +"<br>"+"fuck:"+st[index].fuck+"</li>")
});
})
$("input")
.bind("focus", function () {
$("div").html("请输入您的姓名!");
})
.bind("blur", function () {
if ($(this).val().length == 0)
$("div").html("你的名称不能为空!");
})
.bind("focus", function () {
$("div").html("请输入您的姓名!");
})
.bind("blur", function () {
if ($(this).val().length == 0)
$("div").html("你的名称不能为空!");
})
2015-06-17
不给参数的时候,check.php返回 "偶数",直接打开 http://www.imooc.com/data/check.php 返回>>偶数
所以当数据不是post而是get方式传递的数据,无论任何数返回的都是"偶数".
所以当数据不是post而是get方式传递的数据,无论任何数返回的都是"偶数".
2015-06-17
<script type="text/javascript">
$("li:gt(3)").hide();
$("li:last").show();
$("a").bind('click',function(){
if($("a").html() == "更多"){
$("a").html("简化");
$("li").show();
}else{
$("a").html("更多");
$("li:gt(3)").hide();
$("li:last").show();
}
});
</script>
$("li:gt(3)").hide();
$("li:last").show();
$("a").bind('click',function(){
if($("a").html() == "更多"){
$("a").html("简化");
$("li").show();
}else{
$("a").html("更多");
$("li:gt(3)").hide();
$("li:last").show();
}
});
</script>
$.getJSON("../../data/sport.json",function(data)
2015-06-17
var $strHTML = $("input:hidden").val();
$("div").html($strHTML);
$("div").html($strHTML);
2015-06-17
唔~全都是0吖!
补写:
$("#Text1").val(),
'0'+$("#Text2").val())//加上'0'+这段代码可以计算负数。
补写:
$("#Text1").val(),
'0'+$("#Text2").val())//加上'0'+这段代码可以计算负数。
2015-06-17
$(selector).ajaxStart(function(){$(this).html("请求数据前")});
$(selector).ajaxStop(function(){$(this).html("请求数据后...")});
$(selector).ajaxStop(function(){$(this).html("请求数据后...")});
2015-06-17
使用$("parent>child")选择器,获取的是parent家庭中的全部child子辈,而不包含孙辈child
2015-06-17