Skip to content

Commit

Permalink
Added jquery example
Browse files Browse the repository at this point in the history
  • Loading branch information
jbasdf committed Dec 22, 2011
1 parent f28d000 commit 15c479a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 30 additions & 0 deletions index_jquery.html
Original file line number Diff line number Diff line change
@@ -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>
3 changes: 2 additions & 1 deletion public/js/views/main/main_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 15c479a

Please sign in to comment.