私は、Web技術を使用してデスクトップアプリケーションを構築するためにTitaniumを使用しています。私は自分のMVCとしてBackbone.jsを使うことに決めました。問題は、アプリケーションがサーバー上で実行されないことです。私はこのエラーを取得するオフラインアプリケーションのBackbone.js
window.Student = Backbone.Model.extend({
initialize: function(){
this.bind("save", this.value_change);
},
value_change: function(){
alert("Student model saved for : " + this.attributes.first_name);
},
urlRoot : http://localhost:8080/student/,
});
window.Students = Backbone.Collection.extend({
model: Student,
url: 'http://localhost:8080/students/',
});
と
var students = new Students
students.fetch()
を使用して、サーバーから値を取得してみてください:
message: "'undefined' is not an object (evaluating '$.ajax')"
私はこれが関係していると仮定していますこれは私のバックボーンモデルとコレクションですurl部分と一緒に。サーバーから値をフェッチできません。何か案は?