oetiker / callbackery

Callbackery a Frontend Builder Toolkit
GNU General Public License v3.0
11 stars 10 forks source link

Action.js: Avoid JSON parse errors #192

Closed maettu closed 2 years ago

maettu commented 2 years ago

In Chrome and Firefox, innerHTML we get from the backend is wrapped in (different) forms of <pre></pre>. (Chrome has additional inline styling.)

Remove these tags before trying to parse it as JSON.

Also, parsing an empty string is an error, which still got us the standard "9999 No Data" error.