为什么我收到OPTIONS请求而不是GET请求?

编程入门 行业动态 更新时间:2024-10-25 06:25:46
本文介绍了为什么我收到OPTIONS请求而不是GET请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 <script src="ajax.googleapis/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script> <script> $.get("example/", function(data) { alert(data); }); </script>

它对该URL进行OPTIONS请求,然后永远不调用回调函数.

it does an OPTIONS request to that URL, and then the callback is never called with anything.

当它不是跨网域时,就可以正常工作.

When it isn't cross domain, it works fine.

jQuery是否应该仅使用<script>节点进行调用,然后在加载时进行回调?我知道我将无法获得结果(因为它是跨域的),但是没关系;我只想打通电话.这是一个错误,还是我做错了什么?

Shouldn't jQuery just make the call with a <script> node and then do the callback when its loaded? I understand that I won't be able to get the result (since it is cross domain), but that's OK; I just want the call to go through. Is this a bug, or am I doing something wrong?

推荐答案

选项来自 www.w3/TR/cors/参见 metajack.im/2010/01/19/crossdomain-ajax-for-xmpp-http-binding-made-easy/有关更多信息

The OPTIONS is from www.w3/TR/cors/ See metajack.im/2010/01/19/crossdomain-ajax-for-xmpp-http-binding-made-easy/ for a bit more info

更多推荐

为什么我收到OPTIONS请求而不是GET请求?

本文发布于:2023-10-10 01:28:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1477317.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是   OPTIONS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!