Syntax error in ajax response '=>'
See original GitHub issueOn iPhone (Safari, Chrome) and on OSX Safari I get the following error in console:
SyntaxError: Unexpected token ‘>’
Pointing to this line:
this.$http.patch('/api/things/' + id, thing, { method: 'PATCH'}).then((response) => {
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
javascript - AJAX using jQuery - Syntax Error? - Stack Overflow
Thus, I've created a DOM text-node of your response, and append that instead of just the text string. Note that the edit is...
Read more >ajax request url syntax error in javascript file - Using Django
I have a problem with Ajax Request URL syntax in the Javascript File. When the code is in the html file everything is...
Read more >AJAX call does not seem to work. Receiving 'Uncaught ...
Any help is much appreciated. This is an AJAX call to a shoretel VoIP server internally. I receive 'Uncaught SyntaxError: Unexpected token ILLEGAL...
Read more >console reports syntax error for valid json fetched via jquery.ajax
Since the content type is json and not xml, the xml parser cannot parse it and it results in "Syntax error" being written...
Read more >How to Fix SyntaxError: Unexpected token < in JSON at ...
In this case the error is thrown when response.json() tries to run and fails to parse the data from the server as JSON....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
the example uses ES6 syntax (namely arrow functions), no one is forcing you to use it this way and ES6 is not required to use vue-resource.
Concerning the example, instead of this:
simply do this:
I thought no, but it turns out yes.
this
. At least it did last time I used it with a normal function callback. Seems it doesn’t anymore.… or use a closure.
Arrow functions keep the
this
context of where they are called automatically, so they kind of do the above for you.