您好,欢迎来到[码蚁之家]阅读室   笑话大全   编程问答   问答大全   移民之家   娱乐之家   范文之家   源码下载   电子书籍   软件下载   专题
ASP源码.NET源码PHP源码JSP源码JAVA源码DELPHI源码PB源码VC源码VB源码Android源码
当前位置:首页 >> 网络编程 >> 其他编程教程 >> property referenced in indexed property path is neither an array nor a list nor

property referenced in indexed property path is neither an array nor a list nor(1/2)

来源:网络整理     时间:2016-4-3 23:53:40     关键词:

本篇文章主要介绍了"property referenced in indexed property path is neither an array nor a list nor",主要涉及到方面的内容,对于其他编程教程感兴趣的同学可以参考一下: http://stackoverflow.com/questions/5900840/post-nested-object-to-spring-mvc-cont...

http://stackoverflow.com/questions/5900840/post-nested-object-to-spring-mvc-controller-using-json

http://www.bmchild.com/2014/02/spring-mvc-3-property-referenced-in.html

(function($){// copy from jquery.jsvar r20 =/%20/g,  rbracket =/\[\]$/;
  $.extend({    customParam:function( a ){var s =[],        add =function( key, value ){// If value is a function, invoke it and return its value          value = jQuery.isFunction( value )? value(): value;          s[ s.length ]= encodeURIComponent( key )+"="+ encodeURIComponent( value );};// If an array was passed in, assume that it is an array of form elements.if( jQuery.isArray( a )||( a.jquery &&!jQuery.isPlainObject( a ))){// Serialize the form elements        jQuery.each( a,function(){          add(this.name,this.value );});}else{for(var prefix in a ){          buildParams( prefix, a[ prefix ], add );}}// Return the resulting serializationreturn s.join("&").replace( r20,"+");}});/* private method*/function buildParams( prefix, obj, add ){if( jQuery.isArray( obj )){// Serialize array item.    jQuery.each( obj,function( i, v ){if(rbracket.test( prefix )){// Treat each array item as a scalar.        add( prefix, v );}else{        buildParams( prefix +"["+(typeof v ==="object"|| jQuery.isArray(v)? i :"")+"]", v, add );}});}elseif(obj !=null&&typeof obj ==="object"){// Serialize object item.for(var name in obj ){      buildParams( prefix +"."+ name, obj[ name ], add );}}else{// Serialize scalar item.    add( prefix, obj );}};})(jQuery);



3 down vote

You can try something like this:

相关图片

相关文章