jquery - Why I couldn't see alert when click? -
$(document).ready(function(){ $('.filter a').on('click', function(){ $.ajax({ type: 'get', cache: false, url: 'example.json', datatype: 'json', success: function(data){ alert(data); }, error: function(response) { $("#accordion").css("display","none"); alert("error occured because of no data"); } }); }); });
frustrated while couldn't data show up. puzzled why alert not showing testing. there might have overlooked or missed?
in case: json
[ { "name": "a", "type": "judge" }, { "name": "b", "type": "con" }, { "name":"c", "type":"whatever" }, { "name": "d", "type": "o" } ]
updated
i able error pop in ajax error. still cant data processed. why? saw json on network list loaded properly. don't understand why alert(data) not showing if json loaded.
Comments
Post a Comment