function cbr(s) {//别人做 console.log("催别人做" + s); $.ajax({ url: '/jyddo/ashx/JydDoHandler.ashx', type: 'POST', //GET async: true, //或false,是否异步 data: { action: 'cbrz', s: s }, timeout: 5000, //超时时间 dataType: 'json', //返回的数据格式:json/xml/html/script/jsonp/text Ajax会触发很多事件。 有两种事件,一种是局部事件,一种是全局事件: 局部事件:通过$.ajax来调用并且分配。 beforeSend: function () {//这里是全局事件 // Handle the beforeSend event //loading层 showloading(true);执行函数 }, success: function (data, textStatus, jqXHR) { showloading(false);//关闭loading layer.msg(data.msg);//执行后台回执 if (data.status === 0) { layer.msg(data.msg); layer.msg("已催促工厂加工"); window.location.reload(); } } });
Copyright © 2004-2024 Ynicp.com 版权所有 法律顾问:建纬(昆明)律师事务所 昆明市网翼通科技有限公司 滇ICP备08002592号-4