Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQueryAjax请求(Rails3)被重定向并返回空消息体(仅限SSL)!_Ssl_Jquery_Ruby On Rails 3_Unobtrusive Javascript - Fatal编程技术网

jQueryAjax请求(Rails3)被重定向并返回空消息体(仅限SSL)!

jQueryAjax请求(Rails3)被重定向并返回空消息体(仅限SSL)!,ssl,jquery,ruby-on-rails-3,unobtrusive-javascript,Ssl,Jquery,Ruby On Rails 3,Unobtrusive Javascript,我尝试通过以下方式手动执行jQuery AJAX请求: $("#user_plan_id").change(function() { $("#plan_container").load('/plans/' + this.value); }); 我的头文件中包含了“rails.js”文件,还有一个“” 我从日志中看到请求正在到达服务器(虽然没有Authentication令牌…rails.js会这样做吗?),但响应是302(找到的),而不是200,并且没有实际呈现数据 有什么想法吗 编辑

我尝试通过以下方式手动执行jQuery AJAX请求:

$("#user_plan_id").change(function() {
    $("#plan_container").load('/plans/' + this.value);
});
我的头文件中包含了“rails.js”文件,还有一个“”

我从日志中看到请求正在到达服务器(虽然没有Authentication令牌…rails.js会这样做吗?),但响应是302(找到的),而不是200,并且没有实际呈现数据

有什么想法吗

编辑:我现在看到第一个请求重定向,并在重定向时呈现适当的部分。但是,第二个响应的主体(在客户端)仍然是空的。我猜jQuery使用第一个响应,没有为重定向设置侦听器。我该怎么做

另外,另一个注意事项是:执行请求的页面是HTTPS页面

下面是我的日志所说的:

Started GET "/plans/221168073" for 127.0.0.1 at Tue Jun 15 01:24:06 -0400 2010
  Processing by PlansController#show as HTML
  Parameters: {"id"=>"221168073"}
DEPRECATION WARNING: Using #request_uri is deprecated. Use fullpath instead. (called from ensure_proper_protocol at /Users/ernestsurudo/Sites/vidfolia/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb:57)
Redirected to http://vidfolia.com/plans/221168073
Completed 302 Found in 1ms

事实证明,如果我关闭该页面的SSL要求,它就会工作!不过我还是不知道为什么。因此,我想我的问题是:解决方法是什么?

您是否有可能在某个地方将:协议设置为“http”

嗯,也许这与rails.js是原型并且您正在使用jQuery有关?另一方面,试着让问题更具体一些,比如“使用Rails 3的jQuery AJAX请求被重定向并返回空响应体”或者类似的内容;我将编辑标题。我想答案是