Advertisement
Guest User

Untitled

a guest
Jul 10th, 2011
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(document).ready(function($) {
  2.     //обработчик нажатия на кнопку поиска
  3.     $('.search_button').click(function() {
  4.         if ($("#search_string").val() != '') {
  5.             $(".search_button").attr('disabled', 'disabled');
  6.             $("#search_results").html('Ждите...');
  7.             jQuery.ajax({
  8.                 type: 'GET',
  9.                 url: '/e107_plugins/rwworld/rw_search_handler.php',
  10.                 cache: false,
  11.                 data: {'t': $(this).attr('id'), 's': encodeURIComponent($("#search_string").val()), 'p': 1},
  12.                 dataType: 'html',
  13.                 success: function(text){
  14.                     $("#search_results").html(text).show("slow");
  15.                     $("#search_results").live();
  16.                     $(".search_button").removeAttr('disabled');
  17.                 },
  18.             });
  19.         } else {
  20.             $("#search_results").html("<div class='message'>Укажите в поле '<i>Что ищем?</i>' то, что требуется найти</div>");
  21.         }
  22.         return false;
  23.     });
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement