-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (57 loc) · 2.36 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!--https://experienceleague.adobe.com/docs/target/using/implement-target/client-side/at-js-implementation/deploy-at-js/implementing-target-without-a-tag-manager.html?lang=en#task_E85D2F64FEB84201A594F2288FABF053-->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Experience AEM XF Target Offer</title>
<!--Preconnect and DNS-Prefetch to improve page load time-->
<link rel="preconnect" href="//ags959.tt.omtrdc.net?lang=en">
<link rel="dns-prefetch" href="//ags959.tt.omtrdc.net?lang=en">
<!--/Preconnect and DNS-Prefetch-->
<!--jQuery or other helper libraries should be implemented before at.js if you would like to use their methods in Target-->
<script src="./js/jquery-3.6.0.min.js"></script>
<!--/jQuery-->
<!--Target's JavaScript SDK, at.js-->
<script src="./js/at.js"></script>
<!--/at.js-->
</head>
<body>
<div style="text-align: center; margin-top: 20px">
This pages loads AEM Experience Fragment Offers (authored as JSON and rendered as HTML)
</div>
<div id="aem-offer" style="text-align: center; margin-top: 30px">
Default content before HTML; Loading the XF offer...
</div>
<script>
function loadXF() {
var $aemOffer = $("#aem-offer");
alert("loading directly from publish....")
$.ajax("https://publish-p10961-e90064.adobeaemcloud.com/content/experience-fragments/eaem-cs-at-json-offer/us/en/site/eaem-cs-one/master.html").done(function (html) {
$aemOffer.html(html);
}).fail(function () {
$aemOffer.html("Error loading Publish CS offer");
});
}
loadXF();
/*function loadOffer() {
var $aemOffer = $("#aem-offer");
adobe.target.getOffer({
mbox: 'eaem-test-1',
success: function (offer) {
var offerJSON = JSON.parse(offer[0].content);
if (!offerJSON.xfHtmlPath) {
$aemOffer.html("Error loading offer");
return;
}
$.ajax(offerJSON.xfHtmlPath).done(function (html) {
$aemOffer.html(html);
});
}, error: function () {
$aemOffer.html("Target Error loading offer");
}
})
}
setTimeout(loadOffer, 3000);*/
</script>
</body>
</html>