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

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 1.67 KB  |  hits: 12  |  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. how can I run a piece of jQuery/ajax when a certain php variable = 1?
  2. if $add_total > < $available_achievement_1 { $achievement_1 = '1' }
  3.  
  4.        if $achievement_1 == '1' {
  5.  
  6.     query submit achievement to users database
  7.  
  8.     }
  9.     else {}
  10.        
  11. <script type="text/javascript">
  12.         $(function() {  
  13.             var notice = '<div class="notice">'
  14.                 + '<div class="notice-body">'
  15.                 + '<img src="core/displays/notify/achievement-icon.png" alt="" />'
  16.                 + '<h3>Achievement item</h3>'
  17.                 + '<p>details.</p>'
  18.                 + '</div>'
  19.                 + '<div class="notice-bottom">'
  20.                 + '</div>'
  21.                 + '</div>';
  22.  
  23.             $ny( notice ).purr(
  24.                 {
  25.                     usingTransparentPNG: true
  26.                 }
  27.             );
  28.         });
  29.     </script>
  30.        
  31. if $add_total > < $available_achievement_1 { $achievement_1 = '1' }
  32.  
  33. if $achievement_1 == '1' {
  34.  
  35.     query submit achievement to users database
  36.  
  37.     ?>
  38.         <script type="text/javascript">
  39.             $(function() {  
  40.                 var notice = '<div class="notice">'
  41.                     + '<div class="notice-body">'
  42.                     + '<img src="core/displays/notify/achievement-icon.png" alt="" />'
  43.                     + '<h3>Achievement item</h3>'
  44.                     + '<p>details.</p>'
  45.                     + '</div>'
  46.                     + '<div class="notice-bottom">'
  47.                     + '</div>'
  48.                     + '</div>';
  49.  
  50.                 $ny( notice ).purr(
  51.                     {
  52.                         usingTransparentPNG: true
  53.                     }
  54.                 );
  55.             });
  56.         </script>
  57.     <?PHP
  58.  
  59. }
  60. else {}