jQuery 开发插件
来源:互联网 发布:如何看待知乎live 编辑:程序博客网 时间:2024/06/10 02:58
$.extend
$.fn.extend
实例1
$.extend({
min:function(a,b){ return a<b? a:b},
max:function(a,b){return a>b? a:b}
})
$.min(1,3);//1
$.max(2,4);//4
$.fn.extend
是对jQuery的prototype进行扩展,添加成员函数,jQuery类的实例可以使用这个函数
(function($){
$.fn.extend({
writeparameter:function (url) {
var id="4f1cfcc7-de5d-4739-a8f6-be473a19f10d";
// $.post(basePath+url,
// {id:id},
// function(data,status){
// alert("Data: " + data + "\nStatus: " + status);
//
// },
// "json");
$.ajax({
type:"POST",
url:basePath+url,
data:{
id:id
},
dataType: "json",
success: function(data){
//alert("cg");
$.each(data, function(key, value){
if(key=="select"){
}else{
document.getElementById(key).value=value;
}
});
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert("xx");
}
});
}
});
})(jQuery)
使用
$.("#control").writeparameter(url);
- JQuery插件开发 + 插件
- Jquery系列---Jquery插件开发
- 【jquery】jquery插件的开发
- 【jQuery】jQuery自定义插件开发
- jQuery插件开发-(function($){...})(jQuery)
- jquery开发:jquery插件编写
- jquery 插件开发小组
- jquery插件开发方法
- Jquery插件开发
- jquery插件开发方法
- jQuery插件开发(转载)
- jquery插件开发方法
- JQuery插件开发
- JQuery插件开发
- jquery 插件开发方法
- jQuery插件开发方法
- jquery 插件开发详解
- 开发简单jquery插件
- Android Studio 通过JNA调用 Clang编译的so库,以及Java JNA 调用x64dll,C# dllimport调用x86dll
- 字符串匹配(KMP、Tire、Map)
- springmvc工作流程及实例Demo
- Java Web学习(32): Servlet学习(五)
- MySQL快速入门07----存储引擎
- jQuery 开发插件
- centos7下快速安装mysql
- 最短路,Dijkstra(有趣的赛车比赛,uva 12661)
- AngularJs中directive详解
- iOS开发之蓝牙总结
- Python-ORM-SQLALchemy
- Groory(二) 字符串String+集合Collection篇---极速入门总结
- Execution failed for task ':app:clean'.
- poj1656