Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery(function() {
- jQuery('.searcher-rooms .button').click(function() {
- var n = jQuery.now(),
- l = jQuery('.town-list').val(),
- c = jQuery('.short-hotel-list').val();
- if (l == null) {
- l = 'all';
- };
- if (c == null) {
- c = 'all-hotels';
- };
- if (l != '' && l != 'all' && l != 'current') {
- n += '&l='+l;
- };
- if (c != '' && c != 'all-hotels') {
- n += '&c='+c;
- };
- jQuery.ajax({
- url: theme.child_theme_uri+'/searcher.php?t='+n,
- type: 'GET',
- beforeSend: function() {
- jQuery('#data-wrapper').addClass('loading');
- }
- }).done(function(data) {
- jQuery('#data-wrapper').html(data).attr('data-time', n.toString().split('&')[0]).attr('data-location', l).attr('data-hotel', c);
- jQuery('#data-wrapper').removeClass('loading');
- jQuery('.load-more-hotels').bind('click', d_more_hotels);
- })
- })
- });
- function d_more_hotels() {
- var e = jQuery('#data-wrapper'),
- t = e.attr('data-time'),
- l = e.attr('data-location'),
- c = e.attr('data-hotel'),
- w = jQuery('.load-more-hotels').attr('data-page');
- jQuery.ajax({
- url: theme.child_theme_uri+'/searcher.php?t='+t+'&l='+l+'&c='+c+'&w='+w,
- type: 'GET',
- beforeSend: function() {
- jQuery('#data-wrapper').addClass('loading');
- }
- }).done(function(data) {
- jQuery('#data-wrapper').html(data)
- jQuery('#data-wrapper').removeClass('loading');
- jQuery('.load-more-hotels').attr('data-page', parseInt(w)+1).unbind().bind('click', d_more_hotels);
- })
- }
- url: theme.child_theme_uri+'/searcher.php',
- type: 'GET',
- data: {"t":t, "l":l, "c":c, "w":w} ,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement