我正在开发一个名为shelfari的带有backbone.js +codeigniter的网络应用程序,目录结构如下
目录结构 http://img46.imageshack.us/img46/2506/c180.png
我已在 htdocs 中放置“shelfari”文件夹并以
http://localhost/shelfari/
当调用 model.save 方法时,我想发送一个 post 请求到
POST http://localhost/shelfari/codeigniter/index.php/bookapp
所以我这样定义我的模型
var BookItem = Backbone.Model.extend({
urlRoot:'codeigniter/index.php/bookapp/',
但它发送一个帖子请求
POST http://localhost/codeigniter/index.php/bookapp/ 404 not found
所以我重新定义了网址
var BookItem = Backbone.Model.extend({
urlRoot:'shelfari/codeigniter/index.php/bookapp/',
然后它也发送一个发布请求
POST http://localhost/shelfari/shelfari/codeigniter/index.php/bookapp/ bad error
我应该怎么做才能发送请求
POST http://localhost/shelfari/codeigniter/index.php/bookapp
请帮我找到解决方案