开发者

Data Cache Problem

开发者 https://www.devze.com 2022-12-18 05:52 出处:网络
Facing one major problem related to cache. I have User Creation form in that , if i put value which is already used in textfield then it does 开发者_如何学JAVAnot shows \"Check Availability\" hyper l

Facing one major problem related to cache.

I have User Creation form in that , if i put value which is already used in textfield then it does 开发者_如何学JAVAnot shows "Check Availability" hyper link. but if i put new text then it show hyper link on change of textfield value event.

Code is written in Jquery. I think it's issue of data cache .What is the solution.

If i clear all data from Tool >> Internet Option then it works fine first time Here is the code

$('#userName').change(function(){
        if($('#userName').val()!= BLANK_STRING){            
            $('#checkUser').show();         
        }else{
            $('#checkUser').hide(); 
        }   
        $('#avilabilityMsg').html(''); 
    }); 

Please help?


This might be best suited for the keyup event.

$(function(){
  var userName=$('#userName'), checkUser=$('#checkUser');
  userName.keyup(function(e){
    checkUser[($(this).val()===BLANK_STRING ? 'hide' : 'show')]();
  });
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号