Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 1.77 KB  |  hits: 59  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. update div value - JQuery Toastmessage-plugin
  2. header('Location: completed.php?message=Successful operation. Data inserted for user: ' . $login->get_username() . ' . See home page for infos.');
  3.        
  4. <div id="msg">
  5. <?php echo $_GET['message']; ?>
  6. </div>
  7.        
  8. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  9. <script src="js/jquery.toastmessage.js" type="text/javascript"></script>
  10. <link href="styles/jquery.toastmessage.css" rel="stylesheet" type="text/css" />
  11.  
  12. ...
  13.  
  14. <script type="text/javascript">
  15. function showStickyNoticeToast() {
  16.         $().toastmessage('showToast', {
  17.             text: $('#msg').val(),
  18.             sticky: true,
  19.             position: 'bottom-left',
  20.             type: 'notice',
  21.             closeText: '',
  22.             close: function () { console.log("toast is closed ..."); }
  23.         });
  24.     }
  25. </script>
  26.        
  27. <script type="text/javascript>
  28. <!--
  29. $('#choose').change(function(event) {
  30.     $.get('messages.php', { selected: $('#msg').val() },
  31.         function(data) {
  32.             $('#update').html(data);   // other div wher store data
  33.         }
  34.     );            
  35. });
  36. </script>
  37.        
  38. <?php
  39.  
  40. $alfa = isset($_GET['message']) ? $_GET['message'] : 'nothing';
  41. echo $alfa;
  42. ?>
  43.        
  44. $msg = "Successful operation etc. etc.";
  45. header("Location: completed.php?message="+urlencode($msg));
  46.        
  47. function showStickyNoticeToast( message ) {
  48.         $().toastmessage('showToast', {
  49.             text: message,
  50.             sticky: true,
  51.             position: 'bottom-left',
  52.             type: 'notice',
  53.             closeText: '',
  54.             close: function () { console.log("toast is closed ..."); }
  55.         });
  56.     }
  57.  
  58.  
  59.  
  60. $.post( url , dataToserver, function(data){        
  61.       showStickyNoticeToast( $(data).text())
  62.       $('#update').html(data);
  63.  
  64. })