Jump to content
php.lv forumi

kā lai liek .load apstāties?


Recommended Posts

$(document).ready(function() { 
 $("#add_comment").submit(function(){ 
	$("#submit_comment").hide();
	$(".ajax_loading").show();
	var str = $(this).serialize();  

    $.post("/p_gamma/news/index.php?action=comment", str, function(msg){
	  $("#ncomment_response").ajaxComplete(function(event, request, settings){ 
		$("#submit_comment").show();
		$(".ajax_loading").hide(); 
		if(msg == "OK") {
		 loadContents("#news_comments_r", "/p_gamma/news/index.php?action=read_comments&news_id=1");
		}
		else {
		 var login_response = msg;
		 $("#ncomment_response").html(login_response);
		}  
      });  
    }); 

 return false;  
 });  
});

 

loadContents("#news_comments_r", "/p_gamma/news/index.php?action=read_comments&news_id=1");

Viņš atkārto viņu patstāvīgi. Kā, lai skriptam liek palaist to (loadContents) funkciju tikai vienreiz?

Link to post
Share on other sites

Ok, sanāca, bet kā var no serializētajiem datiem paņemt kādu no tiem datiem, lai varētu izmantot tajā loadContents ?

Nu, piemēram, serializētie dati ir glglg=445&sl=4455&fff=2345345. Tad kā es varu paņemt sl datus, lai izmantotu skriptā:

 

loadContents("#news_comments_r", "/p_gamma/news/index.php?action=read_comments&news_id=1");

 

tā 1-ninieka vietā.

Link to post
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   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...