$.ajax传参数数组的情况

前端之家收集整理的这篇文章主要介绍了$.ajax传参数数组的情况前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
</pre><p class="p1"><span style="font-size:18px;">varidsArry = [];</span></p><p class="p1"><span style="font-size:18px;">//把附件ID存入数组中</span></p><p class="p2"><span style="font-size:18px;"><span class="s1"><span>	</span><span>	</span><span>	</span><span>	</span><span>	</span> </span><span class="s2">idsArry.push(</span>"$accessory.accessoryId"<span class="s2">);</span></span></p><p class="p3"><span style="font-size:18px;"><span>	</span><span>	</span><span>	</span><span>	</span><span>	</span> idsArry.join(<span class="s3">','</span>);</span></p><p></p><p class="p1"></p><pre name="code" class="javascript"><span style="font-size:18px;">jQuery.ajax({
			        type: 'post',url:'$!{base}/private/information/ajaxSaveNormalImangEdit.jhtml',data: {"attStrs":values,"ids":<span style="color:#ff0000;">idsArry.join(',')</span>},dataType:'text/html',error: function(request) {
			           //alert('修改信息附件失败!');
			        },success: function(data) {
			        }
	    		});</span>

//struts中获取不到 ids 为null ,原有在于 没有
<span style="font-size:18px;"><span style="color:#ff0000;">idsArry.join(','),而是 </span><span style="color: rgb(255,0); font-family: Arial,Helvetica,sans-serif;">"ids":</span><span style="color: rgb(255,sans-serif;">idsArry ; 所以就获取不到。</span></span>
原文链接:https://www.f2er.com/ajax/161709.html

猜你在找的Ajax相关文章