我正在使用这个jQuery的watermark plugin。它在每个页面都能正常工作,除了我的注册被调用了4次之外。在注册页面上,我收到了jQuery第57行(一个托管在Google上)的递归错误。我不认为这是jQuery的问题,但我认为它与我的代码或插件有关。你能看看你看到什么吗?jQuery错误:太多的递归
代码:
$(document).ready(function(){
$(".text").addClass("idleField");
$(".text").focus(function(){
$(this).removeClass("idleField");
$(this).addClass("focusField");
});
$(".text").blur(function(){
$(this).removeClass("focusField");
$(this).addClass("idleField");
});
$("#recaptcha_response_field").attr("tabindex","5");
<?php if(!is_ie()){ ?>
$("#username").watermark("Desired Username");
$("#password").watermark("Password between 6 and 12 characters");
$("#confirmPassword").watermark("Confirm Password");
$("#email").watermark("Please insert a valid email");
<?php } ?>
$("#checkUser").click(function(){
$("#results").html("<img src='images/loading.gif' alt='loading...' />loading...");
var user = $("#username").attr("value");
$.get("library/regUserCheck.php", {name: user}, function(data){
$("#results").html(data);
});
});
<?php if($error){ //Make error fade out ?>
$("#errorField").delay(5000).fadeOut(1250);
<?php } ?>
});
什么版本的jQuery您使用的?您使用Google JQuery CDN的链接是什么? – 2011-01-28 21:23:34
1.4.4 https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js – jefffan24 2011-01-28 21:26:10