Backbone hello world
10626 단어 Hello world
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="UTF-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6 <title>Hello World in Backbone.js</title>
7 </head>
8 <body>
9 <!-- ========= -->
10 <!-- Your HTML -->
11 <!-- ========= -->
12
13 <div id="container">Loading...</div>
14
15 <!-- ========= -->
16 <!-- Libraries -->
17 <!-- ========= -->
18 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
19 <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js" type="text/javascript"></script>
20 <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js" type="text/javascript"></script>
21 <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone-localstorage.js/1.0/backbone.localStorage-min.js" type="text/javascript"></script>
22
23 <!-- =============== -->
24 <!-- Javascript code -->
25 <!-- =============== -->
26 <script type="text/javascript">
27 var AppView = Backbone.View.extend({
28 // el - stands for element. Every view has a element associate in with HTML content will be rendered.
29 el: '#container',
30 // It's the first function called when this view it's instantiated.
31 initialize: function(){
32 this.render();
33 },
34 // $el - it's a cached jQuery object (el), in which you can use jQuery functions to push content. Like the Hello World in this case.
35 render: function(){
36 this.$el.html("Hello World");
37 }
38 });
39
40 var appView = new AppView();
41 </script>
42
43 </body>
44 </html>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
고성능 웹 서버 Nginx 의 설정 및 배치 연구 (2) Nginx 입문 급 설정 및 배치 및 "Hello World"우 리 는 Linux/Unix:nginx-1.0.11.tar.gz 을 예 로 들 었 다.다운로드 및 압축 풀기: Nginx 는 많은 소프트웨어 에 의존 하기 때문에 저 희 는 리 눅 스 환경 이 '깨끗 하 다' 고 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.