ユーザーがテキストボックスに入力し、ajax呼び出しが完了した後、画像を削除したいときに、スピニングホイールの画像を表示しています。問題は、画像が消えないことです。コードに記載されているログ情報を確認できるので、コードが実行されていると確信しています。私は何が間違っているのですか?
$(document).ready(function () {
$("[NeedSpellCheck='true']").each(function () {
$(this).keypress(function (e) {
$(this).css("background-image", "url(images/loading.gif)");
$(this).css("background-repeat", "no-repeat");
$(this).css("background-position", "right");
$(this).spellchecker(
{
url: "~/JQuerySpellCheckerHandler.ashx",
lang: "en",
engine: "google",
suggestBoxPosition: "bottom"
}).spellchecker("check", function (result) {
$(this).css("background-image", "none"); // <-- corrected typo
console.log("removed"); //<-- displayed in console
});
});
});
});
<input type="text" NeedSpellCheck="true" />
更新 タイプミスを修正しましたが、それでも機能しません。