-
Notifications
You must be signed in to change notification settings - Fork 1
/
ex4.html
46 lines (40 loc) · 1.31 KB
/
ex4.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
<html>
<head>
<title>Jive</title>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript" src="../jive.min.js"></script>
<script type="text/javascript">
MainController = function() {
this.go = function(req, res) {
req.title = req.title || 'mr.'; // default
if(req.title == 'custom') {
res.title = req.cust_title;
} else {
res.title = req.title;
}
res.name = req.name;
res.renderURL('tpl/hello2.tpl');
}
}
// set the (initial) default controller to use if none specified
Jive.controller = 'Main';
Jive.DEBUG = true;
// run a utility action from the framework's controller, it'll
// route the initial content through a Jive action so we can add
// a history breadcrumb (note the @ prefix in the Jive URL)
$(function(){ Jive.run('@Jive/echo', {content: $('body').html()}); });
</script>
</head>
<body>
<form run="@go">
<p>Classify yourself, human.</p>
<input type="radio" name="title" value="mr.">Male<br />
<input type="radio" name="title" value="mrs.">Female<br />
<input type="radio" name="title" value="custom">
... or something else altogether? <input type="text" name="cust_title" /><br />
Annnnd, your name?
<input type="text" name="name" /><br />
<input type="submit" value="Let's do this" />
</form>
</body>
</html>