ICT News and Updates

because information is for everybody…

The following if – else conditions in javascript:

if statement – simple if statement, executed when condition is true
if…else statement – statements are executed when condition is true or false
if…else if….else statement -  nested if – else statement which can b used for multiple blocks of code
switch statement -  simplified nested if – else statement

Syntax
if statment:
if [...]

  • Share/Bookmark

Here is a sample code on how to extract the mac address of a computer using the powerful javascript.  The code will only work for internet explorer only.
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Getting MAC Address From Javascript(IE Only)</title>
<script language=”javascript”>
function showMacAddress(){
var obj = new ActiveXObject(“WbemScripting.SWbemLocator”);
var s = obj.ConnectServer(“.”);
var properties = s.ExecQuery(“SELECT * FROM Win32_NetworkAdapterConfiguration”);
var e = new [...]

  • Share/Bookmark
  

Recent Entries

    Recent Comments

      Most Commented