-
Notifications
You must be signed in to change notification settings - Fork 0
/
jstest.html
81 lines (60 loc) · 2 KB
/
jstest.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.1/underscore-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script>
<script>
window.Test = {
Views : { },
Models : { }
};
</script>
</head>
<body>
<p>Choose a user ID to investigate</p>
<input type="number" name="id" id="number" min="13286"/>
<div id="output"></div>
</body>
<script>
// var Wallet = {
// name : "This Walletl",
// func : "Holding our cash",
// money : 200,
// makemoney : function(cash){
// this.money = this.money + cash;
// },
// payrent : function(){
// this.money = this.money - 750;
// }
// };
function Wallet(){
this.name = "This Walletl";
this.func = "Holding our cash";
this.money = 200;
this.makemoney = function(cash){
this.money = this.money + cash;
};
this.payrent = function(){
this.money = this.money - 750;
};
}
var KatsWallet = new Wallet();
var JoshsWallet = new Wallet();
$("#output").append("<p>Curently Wallet has " + 0 + " dollars Kat has " + KatsWallet.money + " and Josh has " + JoshsWallet.money + "</p>");
KatsWallet.makemoney(1500);
JoshsWallet.makemoney(12);
$("#output").append("<p>Curently Wallet has " +0 + " dollars Kat has " + KatsWallet.money + " and Josh has " + JoshsWallet.money + "</p>");
KatsWallet.payrent();
JoshsWallet.payrent();
$("#output").append("<p>Curently Wallet has " + 0 + " dollars Kat has " + KatsWallet.money + " and Josh has " + JoshsWallet.money + "</p>");
// $("#number").change(function(){
// var idnumber = $("#number").val();
// $.get("../api/user/user_info/"+idnumber,function(data){
// var username = data.username;
// var email = data.email;
// $("#output").html("The user's name is " + username + " and their email is " + email);
// });
// });
</script>
</html>