forked from blakelee-pendo/blakelee-pendo.github.io
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathiframe-town-inner-2.html
59 lines (52 loc) · 1.58 KB
/
iframe-town-inner-2.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
51
52
53
54
55
56
57
58
59
<html>
<head>
<style>
body {
background-color: rgba(50, 250, 0, 0.3);
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
.text {
padding: 10px;
font-size: 16px;
}
.subtext {
font-size: 10px;
position: absolute;
bottom: 10px;
right: 10px;
}
</style>
<script>// Turns out pendo's snippet requires at least one script tag in the head</script>
</head>
<body>
<div class="text">
Inner, inner iframe. <a href="/iframe-town-inner-3.html">(take me to inner-3)</a>
</div>
<div class="subtext">
...please, no more. I'm begging you
</div>
<textarea id="identify-json" style="width: 400px; height: 400px;margin-left: 20px;"></textarea>
<button id="set-identity">Set visitor ID</button>
<script>
console.log("version 2");
function identify() {
const json = document.querySelector('#identify-json').value;
console.log("raw json is", json);
try {
const identity = JSON.parse(json);
if(!window.__identifyPendoVisitor) {
console.error("window.__identifyPendoVisitor does not exist")
return;
}
window.__identifyPendoVisitor(identity);
} catch(err) {
console.error(err);
}
}
document.querySelector('#set-identity').addEventListener('click', identify)
</script>
</body>
</html>