2010-12-07 53 views

回答

4

HTML之間的文本看看這個SOq:

東西沿着這些路線:

success: function(data) { 
    //create jquery object from the response html 
    var $response=$(data); 
    //query the jq object for the values 
    var dataToday = $response.find('#data-today').text(); 
} 
+0

kool,這將保證儘管html沒有附加到DOM .. + 1 /// – kobe 2010-12-07 04:27:16

2

,如果你想所有的HTML $('#data-today').html() //這一點提出

如果你想要的文字裏面

$('#data-today').text() // this gives hello how are you 

的.text()給出

<div> hello how are you </div> 
+0

@user如果您已經將結果附加到dom,我的答案將起作用。冰雹的答案會讓你從反應中得出結果。 – kobe 2010-12-07 04:26:16

相關問題