javascript - jQuery Ajax: VM845:1 Uncaught SyntaxError: Unexpected token < -


i have small issue. website has been working few month without issue. 2 errors in chrome browser:

vm845:1 uncaught syntaxerror: unexpected token <

and 2nd error 404 /engine_prodjson.php used in 1 of ajax requests. yeah, have managed track error $.ajax function is:

var urlfetch = "/content/engine/engine_prodjson.php"; $.ajax({     type: 'post',     url: urlfetch,     datatype: 'json',     cache: false,     async: true,     success: function(resp){         prodarr = resp;         $('.search').prop('disabled', false);     },     error: function(xhr, status, error) {         var err = eval("(" + xhr.responsetext + ")");         console.log(err.message);     } }); 

i note that, knowledge, neither function, nor engine_prodjson.php has been moved/changed in way. have triple checked via ftp file in fact in correct folder. have checked file permissions set 644.

i have been wondering if hosting's fault has started causing issues approx. 2 hours ago. i'm out of ideas how can fix it.

thanks

because request /engine_prodjson.php results 404 error return data html. of parsing of data using eval("(" + xhr.responsetext + ")"); fail, because < unexpected token in javascript.

in error callback should not add eval("(" + xhr.responsetext + ")");.

why 404 cannot sayed without looking on server. need check in server logs.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -