如何從此輸出中只獲取79個值? {「成功」:「」,「htmlResponse」:79}從PHP中提取JSON的值
我回國這是JSON 我打電話一個PHP函數來獲得通過AJAX的值,這是出來把我的戒備
$.ajax({
url: urlJSON,
success:function(data){
alert(data);
}
<table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr>
<th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>(!)</span> Notice: Undefined variable: success in C:\Apache24\htdocs\project\getPercentageCompleted.php on line <i>7</i></th>
</tr>
<tr>
<th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th>
</tr>
<tr>
<td bgcolor='#eeeeec' align='center'>1</td>
<td bgcolor='#eeeeec' align='center'>0.0040</td>
<td bgcolor='#eeeeec' align='right'>145240</td>
<td bgcolor='#eeeeec'>{main}()</td>
<td title='C:\Apache24\htdocs\tool\index.php' bgcolor='#eeeeec'>..\index.php<b>:</b>0</td>
</tr>
<tr>
<td bgcolor='#eeeeec' align='center'>2</td>
<td bgcolor='#eeeeec' align='center'>0.0250</td>
<td bgcolor='#eeeeec' align='right'>347960</td>
<td bgcolor='#eeeeec'>require_once(<font color='#00bb00'>'C:\Apache24\htdocs\project\actions\getPercentageCompleted.php'</font>)</td>
<td title='C:\Apache24\htdocs\project\index.php' bgcolor='#eeeeec'>..\index.php<b>:</b>39</td>
</tr>
{"success":"","htmlResponse":79}
alert(data ['htmlResponse']); – kums 2014-11-04 23:00:10