直接给代码: headers = a:"this is a" ,b:"this is b" ,c:"this is c" exheaders = e : "this is e",c:"this is c" headers[key] = value for key,value of exheaders alert "key:#{key},value:#{value}" for key,va…
下面代码可以把一个页面容器中的表单元素封装成一个json对象. (function($){ $.fn.serializeObject=function(){ var inputs=$(this).find("input,textarea,select"); var o = {}; $.each(inputs,function(i,n){ switch(n.nodeName.toUpperCase()){ case "INPUT": if($(n).is("…