-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathtemplate.html
executable file
·61 lines (42 loc) · 1.67 KB
/
template.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
<html>
<head>
<title>ADsafe Widget Template</title>
</head>
<body>
<p>This is the page that will contain the widget.</p>
Load a minifed copy of adsafe.js from your domain. You can combine
it with other js files to minimize HTTP transactions.
<script src="http://www.yourTrustedDomain.../adsafe.js"></script>
The widget is given a name that is all uppercase with a trailing
underbar. That name is used with ADSAFE.id and ADSAFE.go. It is
also used a prefix on the IDs of HTML elements in the widget.
The widget starts with a div with the widget ID. All of the widget's
material must be inside of the div.
<div id="TEMPLATE_">
HTML markup required by the widget goes here.
ADSAFE.id is used to inform ADsafe about the widget. Use of ADSAFE.id
is required only if the widget will load library modules.
<script>
ADSAFE.id("TEMPLATE_");
</script>
If library modules are required for the widget, load them here.
<script src="template.js"></script>
ADSAFE.go is passed a function that starts the execution of the widget.
This is required for all widgets.
<script>
ADSAFE.go("TEMPLATE_", function (dom, lib) {
'use strict';
// This is where the code for the widget is placed. It can access
// the document through the dom parameter, allowing it indirect
// access to html elements, allowing it to change content, styling,
// and behavior.
// Each library file can give itself a NAME. This program can access
// the library file as lib.NAME. See template.js.
});
</script>
This the end of the widget.
</div>
Material that is outside of the div cannot be accessed by the widget.
A page could contain many ADsafe widgets.
</body>
</html>