-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
44 lines (41 loc) · 1.07 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Intern tutorial</title>
</head>
<body>
<p id="greeting">Please enter your name</p>
<form id="loginForm">
<input id="nameField" type="text" placeholder="Your name">
<input type="submit" value="Submit">
</form>
<script>
var dojoConfig = {
packages: [ {
name: 'app',
location: location.pathname.replace(/[^\/]*$/, 'app')
} ]
};
</script>
<!--script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script-->
<script src="//js.arcgis.com/3.6amd/"></script>
<script>
require([
'dojo/on',
'dojo/dom',
'app/hello'
], function (on, dom, hello) {
var greeting = dom.byId('greeting'),
loginForm = dom.byId('loginForm'),
nameField = dom.byId('nameField');
on(loginForm, 'submit', function (event) {
event.preventDefault();
greeting.innerHTML = hello.greet(nameField.value).replace(/&/g, '&').replace(/</g, '<');
nameField.value = '';
});
document.body.className += ' loaded';
});
</script>
</body>
</html>