Monday, 19 August 2013

Object has no method sort

Object has no method sort

Hello all i am having an issue with php to java and then sorting i have
the following js script
function sortby(param, data)
{
switch (param)
{
case "aplha":
console.log(data);
data.sort();
break;
}
}
The array this is passing is through json_encode and the array looks like so
Array ( [0] => Array ( [Name] => 123456 [Clean_Name] => 123456
[CreateDate] => 1372479841 ) [1] => Array ( [Name] => 123456 [Clean_Name]
=> 123456 [CreateDate] => 1372479841 ) )
However i get the above error when i try to pass it as data.sort() any
ideas ? so stuck

No comments:

Post a Comment