开发者

jQuery .AJAX is not moving on to the SUCCESS and alerting

开发者 https://www.devze.com 2023-01-18 17:33 出处:网络
See anything wrong with this? $.开发者_运维问答ajax({ url: \'/nav/side\', data: \"urlpath=\" + urlpath,

See anything wrong with this?

$.开发者_运维问答ajax({
    url: '/nav/side',
    data: "urlpath=" + urlpath,
    success: function(data) {
        alert('Load was performed.');
      }
});

For some reason it's not alerting.. I'm using rails 3...

Thanks


There's something outside of your question that's erroring, check your console for errors. For actual request debugging, add an error handler so you can see what's blowing up, like this:

$.ajax({
    url: '/nav/side',
    data: "urlpath=" + urlpath,
    success: function(data) {
        alert('Load was performed.');
    },
    error: function(xhr, status, error) {
        alert('An error occured: ' + status + '\n' + error);
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消