The Global object has properties and methods at the highest level, without a parent object. This means that global properties and functions can be used with all the built-in JavaScript objects.


• The Global object has three properties:
Global object methods (or functions):
- In the following example is a JS script that uses the method eval() twice, transform and interpret the argument received as a JavaScript code.
<script type="text/javascript"><!--
function calcs(form) {
  form.re.value = eval(form.expr.value);
}
eval("alert('Have a good life!')");
--></script>
<form>
 <p>Enter a mathematical expression (addition, subtraction, multiplication, division), for example (7*8 or 3+8/2): </p>
 <input type="text" name="expr" size="35" />
 <input type="button" name="calc" value="Calculation" onclick="calcs(this.form)" /><br />
 The result is:
 <input type="text" name="re" size="18">
</form>
- This code displays an alert window and then the following result. A form that you can use for simple math operations:

Enter a mathematical expression (addition, subtraction, multiplication, division), for example (7*8 or 3+8/2):


The result is:

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag adds an image in web page?
<div> <img> <span>
<img src="http://coursesweb.net/imgs/webcourses.gif" width="191" height="63" alt="Courses-Web" />
Which of these CSS codes displays the text oblique?
font-style: italic; text-decoration: underline; font-weight: 500;
#id {
  font-style: italic;
}
Click on the jQuery function used to hide with animation a HTML element.
click() hide() show()
$(document).ready(function() {
  $(".a_class").click(function(){ $(this).hide("slow"); });
});
Click on the correctly defined function in PHP.
fname function() {} function fname() {} function $fname() {};
function fname($a, $b) {
  echo $a * $b;
}
Global Object

Last accessed pages

  1. Dream Fruit Farm (273)
  2. Mahjongg Alchemy (3348)
  3. Zuma Deluxe (19375)
  4. Qwop (8220)
  5. SHA512 Encrypt hash in JavaScript (5401)

Top accessed pages

  1. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (49383)
  2. Read Excel file data in PHP - PhpExcelReader (37738)
  3. PHP-MySQL free course, online tutorials PHP MySQL code (36753)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (33179)
  5. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (30548)