2010-12-07 62 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