开发者

posting data to server using ajax adds %5Bobject%20Object%5D to url

I am trying to post data to server from my page using following ajax code. However I get an error and the firebug shows that the url it is trying to get is:

http://si开发者_如何学编程tename/%5Bobject%20Object%5Dshelf.php?isbn=9781429958998&shelf=Have+Read+these+books&method=add&success=You+have+read+this+book!&fail=You+have+already+read+this+book!

ajax.runReadThisBook = function() {
    $.get(ajax.site_root_path + "shelf.php", {isbn: ajax.isbn,
                                                     shelf: 'Have Read these books',
                                                    // shelf_id : '1',
                                                     method: 'add',
                                                     success: 'You have read this book!',
                                                     fail: 'You have already read this book!'},

        };
    }, "json");
}


It seems that ajax.site_root_path is an object and not a String (Object).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜