i didn't tested this code on iPhone but i'm sure (tested) it doesn't works on android mobiles:
$('#search').live('keyup',function(key){
if(key.which == 13){
/*ANIMATE SEARCH*/
_key = $(this).val();
$("#wrapper").html("");
$('#wrapper').hide(0).load('results.html').fadeIn(800);
$('#search-fade').val(_key).fadeIn();
}
});
to explain better :
i have a simple
<input type="text" name="search" id="search"/>
don't know why but this code doesn't works properly on android mobile phones
any ideas?
i didn't tested this code on iPhone but i'm sure (tested) it doesn't works on android mobiles:
$('#search').live('keyup',function(key){
if(key.which == 13){
/*ANIMATE SEARCH*/
_key = $(this).val();
$("#wrapper").html("");
$('#wrapper').hide(0).load('results.html').fadeIn(800);
$('#search-fade').val(_key).fadeIn();
}
});
to explain better :
i have a simple
<input type="text" name="search" id="search"/>
don't know why but this code doesn't works properly on android mobile phones
any ideas?
Share Improve this question asked May 14, 2012 at 9:02 Filippo orettiFilippo oretti 49.8k96 gold badges229 silver badges351 bronze badges 2 |2 Answers
Reset to default 10$(document).on('keyup','#search', function() {
// code
});
or
$(document).delegate('#search', 'keyup', function() {
// code
});
You can also see here
My solution (working with jQuery 1.7.1):
$('#search').live('input paste', yourFunction)
Tip:
Use .on()
instead of .live()
, because:
.on()
is faster.live()
is deprecated
jQuery 1.7+ .on() vs .live() Review
Try this:
$(document).on('input paste', '#search', yourFunction)
on()
instead onlive()
, cause live() is deprecated. – The System Restart Commented May 14, 2012 at 9:13