Sunday, December 27, 2009

Re: [jQuery] Ajax values are lost between 2 operations

lots of possibilities here...a link would help.

1) are the correct values being sent in post? Firebug can be very helpful for determining this using the "Show XMLHttpRequests" option.
2)getScript may be getting called  prior to notes.php having finished processing (AJAX is asynchronous), could try putting the getScript as a callback to $Post
3) is the php doing what it is supposed to? withing the callback you could look a the values it generates also to see what is happening

Tristan wrote:
Hi, i've got a little problem and i need your help please :  my script does : 1- post a value in "notes.php" to update values according to what is send. 2- reload the script which calls an flash chart to update it  the problem is :  the datas are correctly updated in /notes.php when calling again the script to update the chart it's working BUT the values in notes.php are reset to initial value (which is 0) so the chart is showed empty (because the charts fils its data with notes.php)   $(document).ready(function(){ 	$("#nomGSP").change(function () {          var hebergeur1 =  $('#nomGSP').val();          $.post("/graphiques/notes.php", { hebergeur1: hebergeur1 } );          $.getScript("graphique3.js");    }); });  Thanks.     

No comments: