forked from signalpoint/jDrupal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (34 loc) · 1.32 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
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<title>jDrupal</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Download jdrupal.js or jdrupal.min.js and include it here! -->
<script src="bin/jdrupal.js"></script>
</head>
<body onload="hello_world()">
<h1>jDrupal</h1>
<p id="message">Loading...</p>
<script type="text/javascript">
function hello_world() {
// Set the site path (without the trailing slash).
Drupal.settings.site_path = ""; // http://www.example.com
// Set the Service Resource endpoint path.
Drupal.settings.endpoint = "";
// Perform a System Connect call.
system_connect({
success:function(result){
// Place custom code here...
if (Drupal.user.uid == 0) { message = "Hello World, Visitor!"; }
else { message = "Hello World, " + Drupal.user.name + "!"; }
document.getElementById("message").innerHTML = message;
},
error:function(xhr, status, message) {
alert(message);
}
});
}
</script>
</body>
</html>