How Ajax works ?

1. Javascript makes invisible call to server
2. sever replies by sending requested data
3. javascript update web page this data.

How to create XMLHttpRequest in ajax ?

function creatObject()
{
var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest();
}
catch(e)  

Read the rest of this entry »

What is static method ?

A static method is one that is called on a class, not on an object.Such methods cannot access properties.

Explain the difference between $message and $$message?

$message is used to store variable data. $$msg can be used to store variable of a variable. Data stored in $message is fixed while data stored in $$message can be changed dynamically.
E.g. $var1 = ‘Variable 1’
$$var1= ‘variable2’
This can be interpreted as $ Variable 1=‘variable2’;
For me to print value of both variables, I will write
$var1 $($var1)

How do I sort an array by key?

The key to sorting by key, is to add a k before the sort to get the function ksort.

This takes the name of the array as the parameter, and works like this: 

Read the rest of this entry »