简体   繁体   English

Bootgrid-意外令牌<JSON中的位置0

[英]Bootgrid - Unexpected token < in JSON at position 0

I am having a bootgrid table which I populate using ajax, the problem is when I select multiple columns from db, after ten columns I receive an error. 我有一个用ajax填充的bootgrid表,问题是当我从数据库中选择多个列时,在十个列之后我收到一个错误。 Does anyone know if boodgrid has a limitation or something. 有谁知道boodgrid是否有限制或其他限制。 I specify that the data are ok, I tested all of them with less than eleven rows and it works perfectly, but if I select more than 10 columns from db I receive this: 我指定数据正常,我用少于11行的数据对所有数据进行了测试,并且效果很好,但是如果我从数据库中选择了10列以上,则会收到以下信息:

Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse () 未捕获到的SyntaxError:JSON中的意外令牌<在JSON.parse(0)位置0
at Function.m.parseJSON (VM217 jquery-1.11.3.js:5) 在Function.m.parseJSON(VM217 jquery-1.11.3.js:5)
at Object.success (VM219 jquery.bootgrid.js:231) 在Object.success(VM219 jquery.bootgrid.js:231)
at j (VM217 jquery-1.11.3.js:2) 在j(VM217 jquery-1.11.3.js:2)
at Object.fireWith [as resolveWith] (VM217 jquery-1.11.3.js:2) 在Object.fireWith [as resolveWith](VM217 jquery-1.11.3.js:2)
at x (VM217 jquery-1.11.3.js:5) 在x(VM217 jquery-1.11.3.js:5)
at XMLHttpRequest.b (VM217 jquery-1.11.3.js:5) 在XMLHttpRequest.b(VM217 jquery-1.11.3.js:5)

Your request doesnt return JSON, but (highly likely) HTML and the HTML starts with <!DOCTYPE or <html> , either starts with your unexpected < . 您的请求不返回JSON,但是(很有可能)HTML和HTML以<!DOCTYPE<html>开头,或者以您意外的<开头。 It tries to parse the HTML as a JSON-string, can't, and errors. 它尝试将HTML解析为JSON字符串,不能解析,并且报错。

If you open your browsers console, go to the tab where you can see the requests made (eg'Network'), select the one with the error and see what you actually get returned. 如果打开浏览器控制台,请转到选项卡,在其中可以查看发出的请求(例如“网络”),选择出现错误的请求,然后查看实际返回的内容。 There will be an error there or other information to push you in the right direction. 那里会有错误或其他信息,将您推向正确的方向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM