Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added jquery example

  • Loading branch information...
commit 15c479a387ba48a8c3d248ac4fb6fba91d858c4b 1 parent f28d000
@jbasdf authored
Showing with 32 additions and 1 deletion.
  1. +30 −0 index_jquery.html
  2. +2 −1  public/js/views/main/main_view.js
View
30 index_jquery.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+ <title></title>
+ <meta http-equiv="content-type" content="text/xhtml; charset=utf-8" />
+ <meta http-equiv="imagetoolbar" content="no" />
+ <meta name="distribution" content="all" />
+ <meta name="robots" content="all" />
+ <meta name="resource-type" content="document" />
+ <meta name="MSSmartTagsPreventParsing" content="true" />
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script>
+</head>
+<body>
+ <div id="content">
+ This file is mean to show multiple versions of jquery on a page. The version loaded by require.js should be isolated from the
+ version in the page.
+ <div>jQuery Version before loading:<span id="before"></span></div>
+ <div>jQuery Version inside main.js should be 1.7.1 is:<span id="inside"></span></div>
+ <div>jQuery Version after loading:<span id="after"></span></div>
+ </div>
+ <script type="text/javascript">
+ $('#before').html($.fn.jquery);
+ </script>
+ <script src="public/js/libs/require/require.js" data-main="public/js/main"></script>
+ <script type="text/javascript">
+ $('#after').html($.fn.jquery);
+ </script>
+
+</body>
+</html>
View
3  public/js/views/main/main_view.js
@@ -12,7 +12,8 @@ define([
this.render();
},
- render: function(){
+ render: function(){
+ $('#inside').html($.fn.jquery);
$(this.el).html(_.template(MainViewTemplate, { 'message': 'Hello World' }));
$('body').append(this.el);
return this;
Please sign in to comment.
Something went wrong with that request. Please try again.