Hi All,
Is it possible to create an Array in PHP and pass it on to Javascript();
I have created an array in php and want to pass it as a parameter to a javascript function.
When i print the array inside PHP i get the following :
But After recieving an array inside a javascript function,
When i code :
it diplays 1
Here is my little javascript function:
When i code :
it displays 'Undefined'
Is it possible to create an Array in PHP and pass it on to Javascript();
If so , then how shoud i go about that.
Thanx in advance
Is it possible to create an Array in PHP and pass it on to Javascript();
I have created an array in php and want to pass it as a parameter to a javascript function.
When i print the array inside PHP i get the following :
Code:
Array ( [0] => 38
[1] => 174
[2] => 172
[3] => 98
[4] => 386 )
But After recieving an array inside a javascript function,
When i code :
Code:
alert(ArryParam.length)
Here is my little javascript function:
Code:
function loadData(Arr)
{
alert(Arr.length);
if (window.ActiveXObject)
}
Code:
alert(Arr[0]);
Is it possible to create an Array in PHP and pass it on to Javascript();
If so , then how shoud i go about that.
Thanx in advance