我需要通过从数据库中获取来在我的页面上显示评论。
我能够从 .json 文件中获取虚拟测试数据,但是当我尝试将其与数据库 url 连接时,它没有获取数据。
我正在使用 js 车把模板来循环 html 页面中的数据。
这是我的 js 来感染数据
var getData = function () {
      console.group("getData()", "Fetching data from server at", R.settings.endPoints.incoming.getData);
      var promise = $.ajax({
        url: R.settings.endPoints.incoming.getData
      });
      console.log("getData()", "Returing the promise", { promise: promise });
      console.groupEnd();
      return promise;
    };
DB url 使用 .getdata 设置,如下所示
endPoints: {
          incoming: {
            getData: "http://localhost:8080/rest/review/getReview"
          },
          outgoing: {
            sendData: "http://localhost:8080/rest/review/createReview"
          }
        }