MCPcopy Create free account
hub / github.com/ampproject/amphtml / createScript

Function createScript

ads/vendors/vlyby.js:41–53  ·  view source on GitHub ↗
(global, id)

Source from the content-addressed store, hash-verified

39 createScript(global, containerId);
40
41 function createScript(global, id) {
42 const s = global.document.createElement('script');
43 const referrer = data['pubref'] || global.context.canonicalUrl;
44
45 s.setAttribute('type', 'text/javascript');
46 s.setAttribute('async', 'true');
47 s.setAttribute('src', '//cdn.vlyby.com/amp/qad/qad-outer2.js');
48 s.setAttribute('data-PubId', data['publisherid']);
49 s.setAttribute('data-PlacementId', data['placementid']);
50 s.setAttribute('data-DivId', id);
51 s.setAttribute('data-PubRef', referrer);
52 global.document.getElementById('c').appendChild(s);
53 }
54 function createContainer(global, id) {
55 const d = global.document.createElement('div');
56 d.id = id;

Callers 1

vlybyFunction · 0.85

Calls 2

setAttributeMethod · 0.45
getElementByIdMethod · 0.45

Tested by

no test coverage detected