大佬教程收集整理的这篇文章主要介绍了jquery – 如何覆盖x-editable ajax响应值?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
例如,我的x-editable链接如下所示:
<a href="#" id="freight">$100</a>
我在x-editable提供的弹出窗口中输入我的编辑,然后输入值300.00
当我进行编辑时,我按以下步骤操作:
$('#freight').editable({ validate: function(value) { if($.trim(value) == '') return 'This value is required.'; },type: 'text',url: '{{ path('update_purchase_order_ajax') }}',pk: {{ purchaSEOrder.id }},title: 'Enter Freight Value',ajaxOptions: { dataType: 'json' },success: function(response,newValue) { // Update the purchase order amounts... $('#freight').html('$' + newValue); } });
当x-editable完成后,页面上显示的值现在为300.00(没有$dollar符号).正如你在我的jquery代码中看到的那样,我试图覆盖x-editable的值,用$(‘#furrency’)放置页面.html(‘$’newValue);
由于某种原因,这是行不通的.我希望300.00美元出现,而不是300.00.
以上是大佬教程为你收集整理的jquery – 如何覆盖x-editable ajax响应值?全部内容,希望文章能够帮你解决jquery – 如何覆盖x-editable ajax响应值?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。