ajax - Extract value from JSON in PHP -


How do I get only 79 out of this output? {"Success": "", "html response": 79}

I'm returning it as a JSON, I'm calling a php function to get a value through Ajax And this is my alert

$ .jax ({url: urlJSON, success: function (data) {warning (data);} & lt; table class = 'xdebug-error xe-notice 'Dir =' ltr 'border =' 1 'cellspacing =' 0 'cellpadding =' 1 '>

Alignment =' left 'bgcolor =' # f57900 'colspan = "5" "& Gt; & lt; span style = 'background-color: # cc0000; color: # fce94f; font-size: x-large,' & gt; & lt; / span & gt; (!): Undefined Variable: Success in C: \ Apache24 \ htdocs \ Project \ getPercentageCompleted.php on line 7 & Lt; T.D. title = 'C: \ Apache24 \ htdocs \ tool \ index.php' bgcolor = '# eeeeec' & gt; .. \ index.php & lt; P & gt; & Lt; / P & gt; 0 & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td bgcolor = '# eeeeec' align = 'center' & gt; 2 & lt; / Td> & Lt; Td bgcolor = '# eeeeec' align = 'center' & gt; 0.0250 & lt; / Td> & Lt; Td bgcolor = '# eeeeec' align = 'right' & gt; 347960 & lt; / Td> & Lt; TD bgcolor = '# eeeeec' & gt; Need_once (& lt; font color = '# 00bb00' & gt; 'C: \ Apache24 \ htdocs \ project \ functions \ getPercentageCompleted.php' & lt; / font & gt;) & lt; / TD & gt; & Lt; T.D. title = 'C: \ Apache24 \ htdocs \ project \ index.php' bgcolor = '# eeeeec' & gt; .. \ index.php & lt; P & gt; & Lt; / P & gt; 39 & lt; / TD & gt; & Lt; / TR & gt;

  {"success": "", "htmlResponse": 79}  

  $ Ajax ({url: urlJSON, success: function) {var myObject = JSON.parse (data); Alert (myObject .htmlResponse);}  

But as long as you use jQuery Why are not you? It is very easy.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -