ajax给全局变量设置值,请先关掉异步上传效果
Posted koaler
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ajax给全局变量设置值,请先关掉异步上传效果相关的知识,希望对你有一定的参考价值。
$.ajax({ type: ‘POST‘, url: "/downloadExcelInfo", timeout: 0, async: false, contentType: "application/x-www-form-urlencoded;charset=utf-8", data: { storename:storename, idstr:idstr, goodsnames:goodsnames, pictures:pictures, column1:column1, filename:filename }, success:function(result){ ssss = result; $("input[name=‘hahaha‘]").attr("value",result); alert(ssss); }, error:function(error) { } }); ssss = result; //给全局变量赋值的时候,要先设置 async: false, 否知赋值是暂时的,不会有效果的。
以上是关于ajax给全局变量设置值,请先关掉异步上传效果的主要内容,如果未能解决你的问题,请参考以下文章