admin管理员组文章数量:1334185
I have a button, the event would be onclick and then the javascript function will send to server the request(for example a rating button on an item), the page should not be redirected, basically I want the event to happen in the background. How to do that? Please give me some idea or code.
I have a button, the event would be onclick and then the javascript function will send to server the request(for example a rating button on an item), the page should not be redirected, basically I want the event to happen in the background. How to do that? Please give me some idea or code.
Share Improve this question asked Mar 7, 2011 at 7:04 Rn2dyRn2dy 4,19012 gold badges44 silver badges59 bronze badges 1- 1 The keyword is AJAX. Please google for it. – deceze ♦ Commented Mar 7, 2011 at 7:07
3 Answers
Reset to default 4Wele to the marvelous world of AJAX. One of the issues with ajax calls is that different browsers have different implementations of ajax. It's better if you can use a javascript library that abstracts these differences. I'd suggest you to pick up jQuery. You can make ajax calls in jQuery using $.get()
, $.post()
or $.ajax()
Check out jQuery.ajax.
you can use jquery ajax to achieve your goal. Its quite simple :)
本文标签: how to send a http request in the background in javascriptStack Overflow
版权声明:本文标题:how to send a http request in the background in javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742319968a2452586.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论