我有以下 jQuery 脚本:
$(document).ready(function() {
$("#resendActivationEmailLink").bind("click", function(event) {
$.get($(this).attr("href"), function() {
$("#emailNotActivated").html("<span>not yet activated. email sent!</span>");
});
event.preventDefault();
return false;
});
});
虽然 ajax 调用确实有效,但不会调用 get() 函数的回调函数,即未调用此行:
$("#emailNotActivated").html("<span>not yet activated. email sent!</span>");
有人可以帮忙吗?
编辑:来自 ajaxError 的请求对象:
Object {readyState: 4, setRequestHeader: function, getAllResponseHeaders: function, getResponseHeader: function, overrideMimeType: function…}
abort: function ( statusText ) {
always: function () {
complete: function () {
done: function () {
error: function () {
fail: function () {
getAllResponseHeaders: function () {
getResponseHeader: function ( key ) {
overrideMimeType: function ( type ) {
pipe: function ( /* fnDone, fnFail, fnProgress */ ) {
progress: function () {
promise: function ( obj ) {
readyState: 4
responseText: "dummy"
setRequestHeader: function ( name, value ) {
state: function () {
status: 200
statusCode: function ( map ) {
statusText: "OK"
success: function () {
then: function ( /* fnDone, fnFail, fnProgress */ ) {
__proto__: Object
编辑2:输出来自:console.log($(this).attr('href'));
/bignibou/resendActivationEmail/235617cb-c19c-4694-ab9e-753e5d7QQde07