在http请求中发送带有持续时间的数据
您好,这是我的 js 代码,用于使用 http 请求将数据发送到服务器。代码工作正常,我可以获取数据,但我希望在调用此函数后每 10 分钟自动发送一次数据。任何人都可以帮助我吗?提前致谢
xmlHttp=new XMLHttpRequest();
var url="http://localhost";
xmlHttp.open("POST",url,true);
var params = "lorem=ipsum&name=binny";
function timerMethod()
{
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.send(params);
}
Hi this is my js code for sent data to server using http request. code working fine and i can get data but i want sent data for every 10mins automatically once i call this function. Can any one help me.thanks in advance
xmlHttp=new XMLHttpRequest();
var url="http://localhost";
xmlHttp.open("POST",url,true);
var params = "lorem=ipsum&name=binny";
function timerMethod()
{
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", params.length);
xmlHttp.send(params);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从这个问题中准确说出你想要什么有点困难,但是你在寻找这样的东西吗?
It's a little difficult to tell exactly what you want from the question, but are you looking for something like this?