格式化金额
var val=‘212312.235423‘var rex = /\d{1,3}(?=(\d{3})+$)/g;val.replace(/^(-?)(\d+)((\.\d+)?)$/, function (s, s1, s2, s3) { ?????????return ‘$‘ + s1 + s2.replace(rex, ‘$&,‘) + s3; })
创建表单,并以post方式提交
$(".details").click(function(){ ?????????????var type=$(this).attr("type"); ???????????var financingAmount=$(this).attr("financingAmount"); ???????????var ?url = "/supplierAccountCenterController/suppliereceivingadd"; ???????????//首先创建一个form表单 ?????????????var tempForm = document.createElement("form"); ???????????????tempForm.id="tempForm1"; ?????????????tempForm.method="post"; ??????????????tempForm.action=url; ?????????????tempForm.target="_blank"; ??????????????//创建input标签,用来设置参数 ?????????????var hideInput = document.createElement("input"); ???????????????hideInput.type="hidden"; ???????????????hideInput.name= "type"; ?????????????hideInput.value= type; ????????????????????????//将input表单放到form表单里 ?????????????tempForm.appendChild(hideInput); ????????????????????????//将此form表单添加到页面主体body中 ?????????????document.body.appendChild(tempForm); ????????????tempForm.submit(); ???????????document.body.removeChild(tempForm); } ??????????
$.ajaxSetup({cache:false}); 设置ajax非缓存机制
判断是否为IE浏览器js代码: (! +[1, ]);
js实用小函数收集
原文地址:https://www.cnblogs.com/codechange/p/8367110.html