vostro Posted November 9, 2011 Report Share Posted November 9, 2011 Sveiki, varat lūdzu sniegt palīdzību, kā pareizi jādara, lai pēc fadeIn jau rādītu no datu bāzes izvadīts pareizs skaitlis, jo kamēr neuztaisīt pilnu lapas pārlādi, rāda veco skaitli. function likeShow(sv){ var url = "/pages/ajaxRating"; $.post(url, {rating : sv}, function(data){ $('#rating').fadeOut(1000).fadeIn(1000); }); Quote Link to comment Share on other sites More sharing options...
Kavacky Posted November 9, 2011 Report Share Posted November 9, 2011 fadeOut callbackā sāc lādēt... kad ielādēts, callbackā sauc fadeIn. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 9, 2011 Report Share Posted November 9, 2011 Nu tev iegūto responsu vajag arī kur parādīt nevis tikai iegūt. :) Mainīgais data, cik redzu, satur to skaitli. Skaitlis - apejamies kā ar skaitli. parseInt(). Ieliekam kāda DOM nodā. Tam vajadzēs vai nu html() vai text(). Beigās varētu izskatīties kā... function (data) { data = parseInt(data); $('#place_for_number').text(data); } P.S. Un par tiem fade* - tā kā Kavacky teica... :) Quote Link to comment Share on other sites More sharing options...
vostro Posted November 9, 2011 Author Report Share Posted November 9, 2011 Liels paldies Kavacky, DaGrevis. function likeShow(sv){ var url = "/pages/ajaxRating"; $.post(url, {rating : sv}, function(data){ alert(data); $('#rating').fadeOut(function(){ $('#rating').html(data); }).fadeIn(1000); }); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.