YaWK  24.1
Yet another WebKit
message-send.js
Go to the documentation of this file.
1 $(document).ready(function(){
2 
3  $('#submit_post').click(function(){
4  var msg_to = $('#msg_to').val();
5  var msg_body = $('#msg_body').val();
6  var fromUID = $('#fromUID').val();
7  var token = $('#token').val();
8 
9  // filter &
10  msg_body = encodeURIComponent(msg_body);
11 
12  if (!msg_body.trim()) {
13  alert('Die Nachricht ist leer. Bitte Text eingeben!');
14  return false;
15  }
16 
17  $.ajax({
18  url:'../system/plugins/messages/js/message-new.php',
19  type:'post',
20  // data:'name='+name+'&comment='+comment+'&id='+id,
21  data:'msg_to='+msg_to+'&msg_body='+msg_body+'&fromUID='+fromUID+'&token='+token,
22  success:function(data){
23  if(! data ){
24  alert('Something went wrong!');
25  return false;
26  }
27  else {
28  // $('#comment_thread').hide();
29  // $('#msg_success').fadeIn();
30  $(data).hide().prependTo("#comment_thread").fadeIn(820).delay( 2600 ).fadeOut( 420 );
31  //reset input boxes
32  $('#msg_to').val('');
33  $('#msg_body').val('');
34  }
35  }
36  });
37  });
38 
39 });
type
Definition: menu-new.php:35
document ready(function(){ $('#submit_post').click(function(){ var msg_to=$('#msg_to').val();var msg_body=$('#msg_body').val();var fromUID=$('#fromUID').val();var token=$('#token').val();msg_body=encodeURIComponent(msg_body);if(!msg_body.trim()) { alert('Die Nachricht ist leer. Bitte Text eingeben!');return false;} $.ajax({ url:'../system/plugins/messages/js/message-new.php', type:'post', data:'msg_to='+msg_to+'&msg_body='+msg_body+'&fromUID='+fromUID+'&token='+token, success:function(data){ if(! data){ alert('Something went wrong!');return false;} else { $(data).hide().prependTo("#comment_thread").fadeIn(820).delay(2600).fadeOut(420);$('#msg_to').val('');$('#msg_body').val('');} } });});})