Jquery ajax - ignore non-json data in response -


i have message form has work both javascript , without.

with js woudl send data ajax. php woudl returning status info (success/failure) encoded in json.

without js form works regular form, except needs status messages returned in plaintext (no way parse json human redable form without js). if try return json data along plaintext error because of datatype : 'json' setting.

can ignoe non json data if js disabled , display onli plaintext without js enabled?

ok, got it. sticked detecting on php side if there ajax request, depending on return json or plaintext.

i detect ajax

if (isset($_server['http_x_requested_with']) && ($_server['http_x_requested_with'] == 'xmlhttprequest'))  

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -