forked from zendesk/zendesk_app_framework_sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiframe.html
41 lines (37 loc) · 860 Bytes
/
iframe.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Iframe me!</title>
</head>
<body>
<script type="text/javascript" src="assets/zaf_sdk.js"></script>
<script>
var app = window.ZAFClient.init(function(context) {
console.log('Hi', context);
});
app.on('helloIframe', function(data) {
if (data.omg) {
console.log('app says hello');
}
});
app.postMessage('helloApp', { awesome: true });
app.request('/api/v2/tickets.json').then(
function(args) {
console.log('success:', args);
},
function(args) {
console.log('fail:', args);
}
);
app.get('ticket.subject').then(
function(args) {
console.log('success:', args);
},
function(args) {
console.log('fail:', args);
}
);
</script>
</body>
</html>