Ajax response is null
Ajax response is null
我有一个AJAX调用,它与我的Rails控制器对话,AJAX可以,但回调不包含任何数据。
我的AJAX调用:
$.ajax({
url: '/get_progress/:' + this.props.myfile,
type: "GET",
dataType: "text",
success: function(data) {
console.log(data);
}.bind(this),
error: function(data) {
console.log("Error");
}.bind(this)
});
我的轨道控制器方法:
def get_progress
a = Rails.configuration.progress
render :text => a
end
我的路线:
get '/get_progress/:id' => 'myfiles#get_progress'
我的AJAX Success回调中没有数据,为什么我的a
值没有返回?
您的url
不正确,:id
只是ID:的值
$.ajax({
url: '/get_progress/' + this.props.myfile,
type: "GET",
dataType: "text",
success: function(data) {
console.log(data);
},
error: function(data) {
console.log("Error");
}
});
相关文章:
- contentWindow.document.body is null
- document.getElementById(..) is null
- jquery TypeError: Response is null
- iframe contentDocument and contentWindow is null
- document.querySelector(...) is null error
- getElementById is null?
- Sbt 0.13 ScriptEngine is Null for getEngineByName(“JavaScrip
- AngularJS "localStorage.getItem" is null in $resou
- javascript canvas is null
- Sails.create even when item is null?
- Jquery ajax POST response is null
- Google App Engine: User is null
- Microsoft.XMLHTTP documentElement is NULL
- TypeError: this.element is null, Rails with Judge gem
- FileReader.readAsArrayBuffer return is null
- TypeError: jasmine.getEnv().currentSpec is null
- gapi.auth.authorize: TypeError: cv(...) is null
- Error document.getElementById is null
- Javascript TypeError: document.getElementById(...) is null
- JavaScript :TypeError: document.getElementById(...) is null