[JavaScript] jquery通过ajax读取json数据 →→→→→进入此内容的聊天室

来自 , 2020-05-19, 写在 JavaScript, 查看 126 次.
URL http://www.code666.cn/view/d128a956
  1. $.get('/path/to/url', function (data) {
  2.   if( !data || data === ""){
  3.     // error
  4.     return;
  5.   }
  6.   var json;
  7.   try {
  8.     json = jQuery.parseJSON(data);
  9.   } catch (e) {
  10.     // error
  11.     return;
  12.   }
  13.  
  14.   // use json here
  15.  
  16. }, "text");
  17. //javascript/4274

回复 "jquery通过ajax读取json数据"

这儿你可以回复上面这条便签

captcha