MCPcopy
hub / github.com/ampproject/amphtml / createPixel

Function createPixel

test/unit/builtins/test-amp-pixel.js:28–36  ·  view source on GitHub ↗
(src, referrerPolicy)

Source from the content-addressed store, hash-verified

26 });
27
28 function createPixel(src, referrerPolicy) {
29 pixel = win.document.createElement('amp-pixel');
30 pixel.setAttribute('src', src);
31 if (referrerPolicy) {
32 pixel.setAttribute('referrerpolicy', referrerPolicy);
33 }
34 win.document.body.appendChild(pixel);
35 return pixel.buildInternal();
36 }
37
38 /**
39 * @param {string=} opt_src

Callers 1

test-amp-pixel.jsFile · 0.70

Calls 2

buildInternalMethod · 0.80
setAttributeMethod · 0.45

Tested by

no test coverage detected