请考虑以下代码:
$.ajax({
url: "http://x.com/api/AnnouncementCategory/Save",
type: "Post",
success: function (data) {
//Grab our data from Ground Control
alert(data);
},
error: function (event) {
对于axios版本为0.22.0的axios.create,会引发未捕获的TypeError 使用以下示例代码创建axios实例时引发异常。 const service = axios.create({
baseURL: "host",
timeout: 3000
}) 引发异常 axios.js:1308 Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at mergeConfig (a
我使用的是webpack,在浏览器中看到以下错误: Uncaught TypeError: Cannot read properties of undefined (reading 'split')
at eval (validator.js:15)
at Object../node_modules/axios/lib/helpers/validator.js (main.bundle.js:1225)
at __webpack_require__ (main.bundle.js:1673)
at eval (Axios.js:8)
a
我最初有一个叫做'g.initWithUserGeolocation‘的函数,它可以成功地工作。它是一个JQuery .get(),它调用一个应该返回JSON对象的http处理程序,然后将该对象的纬度和经度属性赋给两个其他属性
var GMAPS = function (mapHeight, serviceMethodName) {
var g = {}
//center location
g.currentLat = 0;
g.currentLng = 0;
g.initWithUserGeolocation = function () {
var url =