如何把 BrandLevel= val这个值用POST再写入 Manager.asp 而不用 页面转跳?

kwdpx 2017-03-14 08:54:56
<script>
var IsCreateLevel = true;

//品牌过滤 是否使用 规则
var IsBrandLimit = false;

function ShareUrlCreate(Brand_ID,BrandLevel) {
try {
TipLoad.loading();

if (IsCreateLevel) {

$.ajax({
type: 'POST',
url: 'Manager.asp',
data: { action: 'shareurl_NewOrder', Brand_ID: Brand_ID },
dataType: 'json',
timeout: 30000,
success: function (data) {
TipLoad.close();
if (data.id == 1) {

if (data.items) {


console.log(data);

// prompt dialog
alertify.prompt("请输入购买数量", function (e, str) {
// str is the input text
if (e) {
//取级别
var val = $('#select_level').val();
//console.log(val);

alertify.confirm('确定放购买吗?', function(e) {
if (e) {

TipLoad.loading();
//location.href = "ShareAgentList.asp?sq=1&sid=" + Brand_ID + "&BrandLevel=" + val;
//这里本来是用location.href 转向另外一个页面的,如何用POST把 BrandLevel= val这个值再写入 Manager.asp 而不用 页面转跳?
}else{
//没有确认
}
});

// console.log(val);
//

} else {
// user clicked "cancel"
}
}, "");


var list = [];


list = data.items;


//console.log(list);

var data = { list: list}
$('.alertify-text-wrapper').html(template('listHtml', data));

}



} else {

alertify.alert(data.messages);
}

},
error: function (xhr, type) {

alertify.error('超时,或服务错误');
}
});
} else {
location.href = "UrlCreate.php?Id=" + Brand_ID;
}


} catch (e) {

alert(e);
}
}
</script>


提交后怎么可以不用页面转跳,而是用POST继续写入?这样页面可以没有刷新没有转向!
...全文
167 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
li905663280 2017-03-15
  • 打赏
  • 举报
回复
不用页面跳转缺想把数据传送到后台,就用ajax, ajax把brand_level 和brand_id 传送到后台,进行处理后,如果级别选择错误,就用json,返回,在页面用jquery显示
似梦飞花 2017-03-15
  • 打赏
  • 举报
回复
target指向一个iframe?

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧