i just want to ask if how to return or how to call the returned arrays to the function..
this is my javascript
$(document).ready(function(){
alert(askServer());
function askServer()
{
var strUrl = "functions.php";
var strReturn = new Array();
jQuery.ajax({
url:strUrl, success:function(html){strReturn = html;}, async:false
});
return strReturn;
}
});
and this is from my functions.php..
<?php
$dirArray = Array('data_1','data_2','data_3');
echo $dirArray;
?>
my problem is it will alert the word "Array"/...
can it be done like this?
alert(askServer()[0]);
to alert "data_1"?