Morris ajax
发布时间:2020-12-16 01:51:42 所属栏目:百科 来源:网络整理
导读:$.ajax({url:"ajax/some_handler.php",cache:false,type:"POST",data:{anyVar:'specialValue4PHPScriptAndDataBaseFilter'},dataType:"json",timeout:3000,success:function(data){//console.log(data);alert(JSON.stringify(data));Morris.Line({element:'T
$.ajax({ url:"ajax/some_handler.php",cache:false,type:"POST",data:{anyVar:'specialValue4PHPScriptAndDataBaseFilter'},dataType:"json",timeout:3000,success:function(data){ //console.log(data);alert(JSON.stringify(data)); Morris.Line({ element:'TheElementName',data:data,xkey:'someID',ykeys:['R1','R2','R3','R4','R5','R6'],labels:['n1','n2','n3','n4','n5','n6'],hideHover:'auto',resize:true }); },error:function(xmlHttpRequest,textStatus,errorThrown){ alert("Error"+errorThrown); if(textStatus==='timeout') alert("requesttimedout"); }/*References:http://stackoverflow.com/questions/22746646/ajax-i-cant-get-data-from-php-by-using-json-encode*/ }); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |