티스토리 뷰

로컬이나 카페24호스팅에서는 잘 되었는데 다른 카페24호스팅에서는 아래와 같은 에러가 발생하였다.

Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.success ((index):117:18)
    at c (jquery.min.js:2:27742)
    at Object.fireWith [as resolveWith] (jquery.min.js:2:28487)
    at l (jquery.min.js:2:78789)
    at XMLHttpRequest.<anonymous> (jquery.min.js:2:81117)

마치 JSON 에러처럼 보이지만 서버쪽에러일 가능성이 크다. 아래 출처 URL에서 보면 알 수 있으니 공백일경우 발생한다.

공백 즉, 서버에서 값을 못가져왔다는 말이다.

이 전 글에서도 그렇지만 로컬에서 잘 되던게 호스팅에만 올리면 안된다. 호스팅이 오래되서 그런가..

php 다른 함수를 써봐야 겠다. Snoopy 등

출처: https://www.stechies.com/uncaught-syntaxerror-unexpected-end-json-input/

 

Uncaught SyntaxError: Unexpected end of JSON input

A common error encountered by JavaScript programmers is the Uncaught SyntaxError: Unexpected end of JSON input. This is usually observed when the coder is trying to convert a string into a JSON Object, Uncaught SyntaxError: Unexpected end of JSON input, Ja

www.stechies.com

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함