아래 코드가 있는데 자바 스크립트가 전혀 실행되지 않는 것 같습니다.자바 스크립트가 전혀 실행되지 않습니다
내가 여기에서 빠진 것이 있습니까? 당신은 script
태그를 닫는 누락
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Backbonejs</title>
</head>
<body>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js">
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js">
<script type="text/javascript">
Person = Backbone.Model.extend({
initialize: function(){
console.log('hello world');
this.bind('change:name', function(){
console.log(this.get('name') + "is now the val for name");
});
},
defaults: {
name: "Bob hope",
height: "unknown"
},
validate: function(attributes){
if(attributes.name == "Joe"){
return "Uh oh, you're name is Joe!";
}
}
});
var person = new Person();
person.set({name: "Joe", height: "6 feet"});
</script>
</body>
</html>
jQuery가 포함되어 있지 않습니다. 백본의 유일한 의존성은 밑줄입니다 .js –