2010-12-07 6 views

Répondre

4

Jetez un oeil à ce SOq:

Quelque chose le long de ces lignes:

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, ceci fera attention même si html n'est pas attaché à DOM .. + 1 /// – kobe

2

$('#data-today').html() si vous voulez tout le code html // ceci met

si vous voulez que le texte à l'intérieur

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

.text() donne le texte entre html

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

@user ma réponse fonctionnera si vous ajoutez déjà les résultats à dom. réponse icyrock vous obtiendrez ce div résultats de la réponse. – kobe