forked from requirejs/requirejs
/
simple.html
36 lines (34 loc) · 1.26 KB
/
simple.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
<!DOCTYPE html>
<html>
<head>
<title>require.js: Simple Test</title>
<script type="text/javascript" src="../require.js"></script>
<script type="text/javascript" src="doh/runner.js"></script>
<script type="text/javascript" src="doh/_browserRunner.js"></script>
<script>moreSimpleTests = true</script>
<script type="text/javascript" src="simple-tests.js"></script>
<script type="text/javascript">
//This test is only in the HTML since it uses an URL for a require
//argument. It will not work well in say, the Rhino tests.
var path = location.href.replace(/simple\.html$/, "foo"),
index = path.indexOf(":"),
noProtocolPath = path.substring(index + 1, path.length).replace(/foo/, "bar");
require([path, noProtocolPath], function() {
doh.register(
"fooBar",
[
function fooBar(t){
t.is("foo", foo.name);
t.is("bar", bar.name);
}
]
);
doh.run();
});
</script>
</head>
<body>
<h1>require.js: Simple Test</h1>
<p>Check console for messages</p>
</body>
</html>