MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / disableScript

Function disableScript

libs/jquery-3.5.1/jquery-3.5.1.js:5987–5990  ·  view source on GitHub ↗
( elem )

Source from the content-addressed store, hash-verified

5985
5986// Replace/restore the type attribute of script elements for safe DOM manipulation
5987function disableScript( elem ) {
5988 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
5989 return elem;
5990}
5991function restoreScript( elem ) {
5992 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
5993 elem.type = elem.type.slice( 5 );

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected