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

Function writeScript

3p/3p.js:68–76  ·  view source on GitHub ↗
(win, url, opt_cb)

Source from the content-addressed store, hash-verified

66 * @param {function()=} opt_cb
67 */
68export function writeScript(win, url, opt_cb) {
69 win.document.write(
70 // eslint-disable-next-line no-useless-concat
71 '<' + 'script src="' + encodeURI(url) + '"><' + '/script>'
72 );
73 if (opt_cb) {
74 executeAfterWriteScript(win, opt_cb);
75 }
76}
77
78/**
79 * Asynchronously load the given script URL.

Callers 15

getMathmlJsFunction · 0.90
getGistJsFunction · 0.90
myoffrzFunction · 0.90
adopFunction · 0.90
adreactorFunction · 0.90
fusionFunction · 0.90
smartTagFunction · 0.90
quoraadFunction · 0.90
adverlineFunction · 0.90
adverticumFunction · 0.90
yahoojpFunction · 0.90
rakutenunifiedadsFunction · 0.90

Calls 2

executeAfterWriteScriptFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected