javascript script in the browser
Javascript code can be executed
via the script html tag
function globalEval( data ) {
if ( data && jQuery.trim( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
}
}
<button class="btn btn-info" onclick="console.log('1+1='+(1+1))" >1+1= ... </button>
For example, the following document fragment:
$.ajax({
method: "GET",
url: "test.js",
dataType: "script"
});