Skip to content

Instantly share code, notes, and snippets.

@ando19721226
Created January 28, 2013 15:46
Show Gist options
  • Save ando19721226/4656594 to your computer and use it in GitHub Desktop.
Save ando19721226/4656594 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<title>test index</title>
</head>
<body>
<div></div>
<script type="text/template" id="modal-test">
<div class="modal" id="hoge">
<div class="modal-header">
<h3>New Project</h3>
</div>
<div class="modal-body">
abc
</div>
<div class="modal-footer">
<button class="btn primary" id="ok">OK</a>
<button class="btn" id="cancel">Cancel</a>
</div>
</div>
</script>
<script type="text/template" id="piyo">
ando
<button>aaa</button>
</script>
<script src="jquery.min.js"></script>
<script src="underscore.js"></script>
<script src="backbone.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script>
var View = Backbone.View.extend({
el: "body",
events: {
"click #ok": "_ok"
},
initialize: function () {
this.render();
},
render: function () {
var template = $("#modal-test").html();
$(template).modal({
backdrop: false
});
},
_ok: function () {
alert("abc");
}
});
var view = new View();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment