[AJAX] Erreur Unterminated string literal
Bonjour,
j'ai un problème sur le code ci-dessous, si dans le paramètre $row["titre"] du onclick j'ai un espace !
Lorsque je clique voici l'erreur:
unterminated string literal
[Break On This Error] submitInfo('Dans
Je me doute que c'est un problème de guillemets mais j'ai beau tout essayer cela ne fonctionne pas !
pouvez-vous m'aider?
titre.php:
Code:
1 2
|
echo "<li onclick="."submitInfo('".$row["titre"]."')".">".$row["titre"]."</li>"; |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
function submitTitre(table,nom,prenom){
$.ajax({
url : "titre.php"
, type : "GET"
, data : "table="+table+"&nom="+nom+"&prenom="+prenom
, success : function(rep,statut,xhr){
$("#titre").html(rep);
}
, error : function(xhr,statut){
$(this).text("Erreur: " + statut + xhr.statusText);
}
});
} |
Merci d'avance pour votre aide.