js代码这样写,是什么意思?作用是什么?我以前没用过,请大侠解释一下,它与function disable(){}有区别吗?区别在那里?disable: function(){
if(this[0] && this.type!="select-one"){
for(var i=0;i<this.length;i++){
this[i].disabled= true;
}
}else{
this.disabled= true;
}
}
if(this[0] && this.type!="select-one"){
for(var i=0;i<this.length;i++){
this[i].disabled= true;
}
}else{
this.disabled= true;
}
}
解决方案 »
- myeclipse 加载jquery的问题
- 带参数方法的回调怎么去实现
- 大家提提意见!!!
- 我要一段背景是黑色的的天气代码?
- 如何保存网页中的<table>到html文件
- 找人修改一正则!
- 关于安全性、受信任站点之类的一个问题,总之就是权限问题
- 如何自动向在线字典网站提交一组生词,然后,返回结果,大家有什么主意
- JAVASCRIPT中,window.form1.submit();window.close();两句,经常只执行CLOSE,怎么办?
- 请问有谁知道哪儿有比较好的免费空间吗,现在可以申请的??谢!11
- 关于jquery lightbox的问题
- 现我用JS获取了一段HTML代码返回到页面上,但很多我都用不到,我只想提取有用的信息可以吗?
var person={
sex:0,
pk:function(s){
alert(s);
}
}
//调用
alert(person.sex)
person.PK("123")
var bb={
disable: function(){
if(this[0] && this.type!="select-one"){
for(var i=0;i <this.length;i++){
this[i].disabled= true;
}
}else{
this.disabled= true;
}
},
able: function(){
if(this[0] && this.type!="select-one"){
for(var i=0;i <this.length;i++){
this[i].disabled= true;
}
}else{
this.disabled= true;
}
}}
是什么意思?是定义一个数组吗?
$("select option").attr("selected", true);
var ops = {
beforeSubmit: function(formArray, jqForm) {
if($("option[selected]",$("#to")).size()==0){
alert(send_to);
return false;
}else{
$("#mailing").html("Sending...");
}
},
success: function(responseText) {
$("#mailing").html("");
alert(responseText);
}
};
$("#oform").ajaxSubmit(ops);
}楼上,我还想问一下,像这个发信的js中的beforeSubmit与success属性,我在那里可找到引用它们的地方?ops对象放到了ajaxSubmit方法中充当参数,是不是在ajax的这个方法中封装了调用这两个属性的方法?