אשכול: עזרה בAJAX
View Single Post
ישן 13-08-08, 04:02   # 5
intercooler3819
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Jul 2008
הודעות: 1,056

intercooler3819 לא מחובר  

this is an sample ajax request:
קוד:
<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script>
$("div#validate_information").click( function() {
   username = $("div#username");
   password = $("div#password");
     $.get("a.php", { user: username.text(), pass: password.text() }, function(returnedValue){
      class = "ohboy";
          if (returnedValue == "okay")
             class = "okay";
      username.addClass(class);
          password.addClass(class);
     });
});
</script>
i really don't know why i wrote it in JQUERY but im not going to rewrite it (;
btw
i would use JSON to serialize the variables i want to send in this stream
__________________
  Reply With Quote