gpt4 book ai didi

javascript - 没有 jQuery 的 Ajax

转载 作者:行者123 更新时间:2023-11-30 18:14:00 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How to make an ajax call without jquery?

我在 js(Ajax) 中有代码,但我想在没有 Ajax(XMLHttpRequest) 的情况下实现它

$.ajax({
type:'POST',
data:'slug='+prize,
url:'/wybrana-nagroda/',
success:function(msg)
{
$('#whaiting').hide();
if(msg==='winner')
$(window.location).attr('href','/formularz');
}
});

它应该是什么样子?

function send(post, url) {
var client = new XMLHttpRequest();
client.open("POST", url);
client.send(message);
}

?

谢谢。

25 4 0
文章推荐: javascript - $.post 不工作(任何地方)!为什么?
文章推荐: javascript - 在 firefox 或 chrome 中使用 javascript 访问文件系统?
文章推荐: javascript - 无法使用 javascript 将新文本框动态添加到
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com