salut,
je viens vers vous car j'ai un soucis suite au changement de version de mon fichier jquery.
J'utilise le script suivant pour ma shoutbox et il fonctionne très bien avec la vesrion 1.2.6 de jquery. Mais lorsque j'utilise la 1.9.0 ou 1.9.1 mon script me retourne "Merci d'écrire un message".
Ca fais comme si le champ était vide...
Voici le script de ma shoutbox :
[javascript]
$(document).ready(function(){
//global vars
var inputUser = $("#pseudo");
var inputMessage = $("#mess");
var loading = $("#loading");
var messageList = $(".content > ul");
//functions
function updateShoutbox(){
//just for the fade effect
messageList.hide();
loading.fadeIn();
//send the post to shoutbox.php
$.ajax({
type: "POST", url: "shoutbox.php", data: "action=update",
complete: function(data){
loading.fadeOut();
messageList.html(data.responseText);
messageList.fadeIn(2000);
}
});
}
//check if all fields are filled
function checkShout(){
if(inputUser.attr("value") && inputMessage.attr("value"))
return true;
else
return false;
}
//Load for the first time the shoutbox data
updateShoutbox();
//on submit event
$("#shout").submit(function(){
if(checkShout()){
var pseudo = inputUser.attr("value");
var mess = inputMessage.attr("value");
//we deactivate submit button while sending
$("#send").attr({ disabled:true, value:"Sending..." });
$("#send").blur();
//send the post to shoutbox.php
$.ajax({
type: "POST", url: "shoutbox.php", data: "action=insert&pseudo=" + pseudo + "&mess=" + mess,
complete: function(data){
messageList.html(data.responseText);
updateShoutbox();
//reactivate the send button
$("#send").attr({ disabled:false, value:"Envoyer !" });
}
});
}
else alert("Merci d'écrire un message!");
//we prevent the refresh of the page after submitting the form
return false;
});
});
[/javascript]
Avez vous une idée pour ce problème?
Merci