Jump to content
php.lv forumi
  • 0

jQuery AJAX


eT`

Question

Tātad gribu izveidot galeriju sistēmai ( kas lieto Galleria skriptu ) komentāru sistēmu.

It kās doma bija par aptuveni šādu kodu:

 


$(document).ready(function () {
var pic,id;
pic = $(".galleria-current").text(); 
//alert(pic);
var request = $.ajax({
  url: "/showcomments",
  type: "POST",
data: {id : pic},
success: function(data)
{
$("#koment").append(data);
}
});


});
</script>

 

pic nolasa tagadējās bildes numuru un padod kā POST caur AJAX uz showcomments, lai izvilktu attiecīgos komentārus un attēlotu komentēšanas formu.

 

bet nezinu pat vai šāda ideja strādās.

 

kā Jūs ieteiktu vislabāk realizēt šādu ideju?

 

Ideja:

- Galerija ( bildes tiek ar Galleria attēlotas )

- Pie bildes pārslēgšanas pārlāde komentāru div ( šeit laikam document.ready() nestrādās ) un parāda komentēšanas formu

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...