the bellow scripts runs at my Local Host but does not work at my Site.
I'm just testing simple Json script in jqueryMobile list format
any idea what is wrong??
thanks
HTML page click to call Ajax function:
Json format
info
call Ajax here:
var areaID=0;
function jsn1(val)
{
var url_Category="http://gonorth.co.il/protected/indexJSON.php?";
$.ajax({
url: url_Category,
type: "GET",
data: 'No='+val+"&area="+areaID,
dataType: "json",
cache: false,
error: function () {
alert('loading Ajax failure');
} ,
onFailure: function () {
alert('Ajax Failure');
} ,
statusCode: {
404: function() {
alert("missing info");
}
},
success: function(result) {
$('#sitesList li').remove();
$.each(result.sites,function(index,dat){
$("#sitesList").append(
'
'+ '' +
'
Name: '+dat.coupon_name+'
'+'
info: '+dat.street+'
'+'
address:'+dat.coupon_tmp+'
'+'
');
});
$('#sitesList').listview('refresh');
}
});
}
PHP results:
$arr = array();
$arr[] =[
"coupon_id" => '1',
"coupon_img" => '1.jpg',
"street" => 'long text',
"coupon_tmp" => 'Address',
"coupon_name" => 'Name'
];
echo '{"sites":'.json_encode($arr).'}';
?>