admin管理员组文章数量:1416866
I'm trying to find if its possible to send POST to url using only html and javascript. According to this its not possible. Can anyone knowledgeable tell me is it possible ? and if it's how to do it? ad1 Without using jQuery
I'm trying to find if its possible to send POST to url using only html and javascript. According to this its not possible. Can anyone knowledgeable tell me is it possible ? and if it's how to do it? ad1 Without using jQuery
Share Improve this question asked Mar 5, 2013 at 16:07 whdwhd 1,8611 gold badge22 silver badges55 bronze badges 1- 1 Take a look here it may help stackoverflow./questions/133925/… – Marcos Brigante Commented Mar 5, 2013 at 16:12
4 Answers
Reset to default 2If you consider jQuery to be JavaScript it sure is.
See here:
http://api.jquery./jQuery.post/
If you're going to be doing a lot of this sort of thing in your development in the future, I'd highly remend you get used to using jQuery.
If you really want to you can use XMLHttpRequest. All major browsers support it.
I'm trying to find if its possible to send POST to url using only html and javascript.
Yes
According to this its not possible.
No. The Same Origin Policy, in general, prevents you reading data from different origins. Pre-flight checks sometimes prevent you sending data, but there are several ways to circumvent the policy.
and if it's how to do it? ad1 Without using jQuery
XMLHttpRequest and jQuery.ajax are well documented.
As per the article, if the URL is not in the same origin, it is not possible. This is for security reasons.
If it's within the same origin (domain) then it is possible.
Pure JS (no frameworks) examples here: http://www.w3schools./ajax/ajax_xmlhttprequest_send.asp
本文标签: javascriptSend post to URL using jshtmlStack Overflow
版权声明:本文标题:javascript - Send post to URL using jshtml - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744636685a2616862.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论