我在我的chrome console.username availaibility中遇到了這個錯誤。但密碼強度不起作用。我新的javascript請幫我..Uncaught TypeError:Object#<Object> has no method'password_strength'
<script type="text/javascript">
$(function()
{
$('.user_name').keyup(function()
{
var checkname=$(this).val();
var availname=remove_whitespaces(checkname);
if(availname!='' && availname.length >= 5){
$('.check').show();
$('.check').fadeIn(400).html('</br> </br> <img src="img/ajax-loading.gif" style="height:20px;width:20px" /> ');
var String = 'username='+ availname;
$.ajax({
type: "POST",
url: "available.php",
data: String,
cache: false,
success: function(result){
var result=remove_whitespaces(result);
if(result==''){
$('.check').html(' </br> </br> <img src="img/accept.png" style="height:20px;width:20px" /> This Username Is Avaliable');
$(".check").removeClass("red");
$('.check').addClass("green");
$(".user_name").removeClass("yellow");
$(".user_name").addClass("white");
}else{
$('.check').html('</br> </br><img src="img/error.png" style="height:20px;width:20px" /> This Username Is Already Taken');
$(".check").removeClass("green");
$('.check').addClass("red")
$(".user_name").removeClass("white");
$(".user_name").addClass("yellow");
}
}
});
}else{
$('.check').html('');
}
});
$('.passwd').password_strength();
});
function remove_whitespaces(str){
var str=str.replace(/^\s+|\s+$/,'');
return str;
}
</script>
我在我的鉻console.username availaibility得到這個錯誤工作很好。但密碼強度不起作用。我新的JavaScript請幫助我..
'code' $( 'passwd文件。')password_strength()後,密碼jQuery腳本。在這條線上得到錯誤 – dvirus