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

Function addExisting

test/unit/test-runtime.js:421–428  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

419 rtvVersion: 'test-version',
420 };
421 function addExisting(index) {
422 const s = document.createElement('script');
423 const name = 'amp-test-element' + index;
424 s.setAttribute('custom-element', name);
425 s.setAttribute('src', `https://cdn.ampproject.org/v0/${name}-0.1.js`);
426 win.document.head.appendChild(s);
427 return s;
428 }
429 const s1 = addExisting(1);
430 const s2 = addExisting(4);
431 const s3 = addExisting(5);

Callers 1

test-runtime.jsFile · 0.85

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected