JQuery动画崩溃,并显示"Microsoft JScript运行时错误:对象不支持此属性或方法". [英] JQuery animate crashes with "Microsoft JScript runtime error: Object doesn't support this property or method"
问题描述
我有一个更新数据绑定行的Web服务,成功后,我希望该行突出显示绿色,然后改回其原始颜色,但是最困难的是完成最简单的部分(动画).这是我的JavaScript代码,直到动画部分起作用为止:
I have a web service that updates a databound row, on success I want the row to highlight green then change back to its original color but I am having the most difficulty accomplishing the easiest part (the animate). Here is my javascript code, it works up until the animate part:
<script type="text/javascript">
function lbUpdateCriteria_Click(srcEl) {
var vId = srcEl.getAttribute("CriteriaVestingId");
var currentTr = $(srcEl).closest("tr");
var typeId = currentTr.find("[getValue=ddlVestingCriteriaType" + vId + "]").val();
var lowerBound = currentTr.find("[getValue=tbLowerBound" + vId + "]").val();
var upperBound = currentTr.find("[getValue=tbUpperBound" + vId + "]").val();
UpdateVestingCriteria(vId, typeId, lowerBound, upperBound, currentTr);
}
function UpdateVestingCriteria(vId, typeId, lowerBound, upperBound, currentTr) {
var webMethod = "../Service/UpdateCriteria.asmx/UpdateNewCriteria";
var parameters = "{'criteriaVestingId':'" + vId + "','criteriaTypeId':'" + typeId + "','lowerBound':'" + lowerBound + "','upperBound':'" + upperBound + "'}";
$.ajax({
type: "POST",
url: webMethod,
data: parameters,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
// This is where it breaks....
currentTr.animate({ backgroundColor: "#48B84B" }, 1000);
//currentTr.css("backgroundColor", "#48B84B");
// setTimeout(function () { $(currentTr).effect("highlight", { color: "#FFFFFF" }, 2000); }, 2000);
},
error: function (e) {
debugger;
alert(e.statusText)
}
});
}
</script>
当到达currentTr.animate({...})行时,它将引发此错误
When it gets to the line currentTr.animate({...}) it throws this error
Microsoft JScript runtime error: Object doesn''t support this property or method
我已经检查过我的jqueryui是最新版本1.8.22,我还尝试了其他的jqueryUI函数,例如css,它们在行上可以正常工作.我不知道还有什么问题.我已经尝试使用Google搜索错误,但对我没有任何反应.任何帮助或建议,将不胜感激.
I''ve checked my jqueryui is the latest version 1.8.22, I''ve also tried other jqueryUI functions like css that do work correctly on the row. I don''t know what else could be the problem. I''ve tried googling the error and nothing relavent to me comes up. Any help or suggestions would be greatly appreciated.
推荐答案
(srcEl).closest(" tr"); var typeId = currentTr.find(" + vId + ]").val(); var lowerBound = currentTr.find(" + vId + ]").val(); var upperBound = currentTr.find(" + vId + ]").val(); UpdateVestingCriteria(vId,typeId,lowerBound,upperBound,currentTr); } 函数UpdateVestingCriteria(vId,typeId,lowerBound,upperBound,currentTr){ var webMethod = " ; var 参数= " + vId + " + typeId + " + lowerBound + " ','upperBound':'" + upperBound + '}";
(srcEl).closest("tr"); var typeId = currentTr.find("[getValue=ddlVestingCriteriaType" + vId + "]").val(); var lowerBound = currentTr.find("[getValue=tbLowerBound" + vId + "]").val(); var upperBound = currentTr.find("[getValue=tbUpperBound" + vId + "]").val(); UpdateVestingCriteria(vId, typeId, lowerBound, upperBound, currentTr); } function UpdateVestingCriteria(vId, typeId, lowerBound, upperBound, currentTr) { var webMethod = "../Service/UpdateCriteria.asmx/UpdateNewCriteria"; var parameters = "{'criteriaVestingId':'" + vId + "','criteriaTypeId':'" + typeId + "','lowerBound':'" + lowerBound + "','upperBound':'" + upperBound + "'}";
.ajax({ 类型:" , 网址:webMethod, 数据:参数, contentType:" , dataType:" , 成功:功能(msg){ // 这是中断的地方.... currentTr.animate({backgroundColor:" }, 1000 ); // currentTr.css("backgroundColor",#48B84B"); // setTimeout(function(){
.ajax({ type: "POST", url: webMethod, data: parameters, contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { // This is where it breaks.... currentTr.animate({ backgroundColor: "#48B84B" }, 1000); //currentTr.css("backgroundColor", "#48B84B"); // setTimeout(function () {
(currentTr).effect(高光",{color:"#FFFFFF"},2000);},2000); }, 错误:功能(e){ 调试器; 警报(e.statusText) } }); } </ 脚本 >
(currentTr).effect("highlight", { color: "#FFFFFF" }, 2000); }, 2000); }, error: function (e) { debugger; alert(e.statusText) } }); } </script>
当到达currentTr.animate({...})行时,将引发此错误
When it gets to the line currentTr.animate({...}) it throws this error
Microsoft JScript runtime error: Object doesn''t support this property or method
我已经检查过我的jqueryui是最新版本1.8.22,我还尝试了其他的jqueryUI函数,例如css,它们在行上可以正常工作.我不知道还有什么问题.我已经尝试使用Google搜索错误,但对我没有任何反应.任何帮助或建议,将不胜感激.
I''ve checked my jqueryui is the latest version 1.8.22, I''ve also tried other jqueryUI functions like css that do work correctly on the row. I don''t know what else could be the problem. I''ve tried googling the error and nothing relavent to me comes up. Any help or suggestions would be greatly appreciated.
这篇关于JQuery动画崩溃,并显示"Microsoft JScript运行时错误:对象不支持此属性或方法".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!