PHP Classes

File: js/search.js

Recommend this page to a friend!
  Classes of Francesco Crisetti   PHP CDN   js/search.js   Download  
File: js/search.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP CDN
Display images from a given directory using AJAX
Author: By
Last change:
Date: 8 years ago
Size: 924 bytes
 

Contents

Class file image Download
jQuery(function($){ var typingTimer; $("#search-image").keyup(function(){ clearTimeout(typingTimer); var val = $(this).val(); typingTimer = setTimeout(function(){doneTyping(val)}, 300); }).keydown(function(){ clearTimeout(typingTimer); }); }); function doneTyping(val){ jQuery(function($){ $("#loading").show(); $("#content-file").html(""); if($(".mdl-collapse__link-active").length) $(".mdl-collapse__link-active").removeClass("mdl-collapse__link-active"); $.ajax({ url: "", method: "POST", dataType: 'text', data: { t: "ajax", m: 'files', f: 'searchByName', n: val }, success: function(value) { $("#loading").hide(); $("#content-file").html(value); componentHandler.upgradeElements($('.mdl-tooltip').get()); }, error: function () { var message = new Message("Errore nel recupero dei file!", "error"); message.show(); } }); }); }