Browser - Javascript

1 - About

javascript script in the browser

3 - Management

3.1 - Execution

Javascript code can be executed

3.1.1 - Script

via the script html tag

3.1.2 - Eval function

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 );
	}
}

3.1.3 - On Attribute

<button class="btn btn-info" onclick="console.log('1+1='+(1+1))" >1+1= ... </button>

For example, the following document fragment:

3.2 - Asynchronous load and execution

  • a Jquery with Ajax - Load and execute a JavaScript file.
$.ajax({
  method: "GET",
  url: "test.js",
  dataType: "script"
});

Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap