我想在 DOM 完全加载后为对象设置值。OnBlur
问题是,在从文本框中调用一个和OnFocus
事件后,我得到一个空指针异常。我究竟做错了什么?
javascript:
$(document).ready(function () {
var sumThursdayHrs = $('span[id*="lblThursdayHrs"]').last()
});
var tempThursdayHrs = 0.0;
function BlurThursdayHrs(sender, args) { sumThursdayHrs.text(tempThursdayHrs + sender.get_value()); }
function FocusThursdayHrs(sender, args) { tempThursdayHrs = sumThursdayHrs.text() - sender.get_value(); }
标记:
<telerik:RadNumericTextBox ID="txtThursdayHrs" runat="server" NumberFormat-DecimalDigits="1"
Width="25px" MinValue="0" Type="Number" DbValue='<%# Eval("ThursdayHrs") %>'>
<ClientEvents OnBlur="BlurThursdayHrs" OnFocus="FocusThursdayHrs" />
</telerik:RadNumericTextBox>
错误:
Microsoft JScript 运行时错误:“sumThursdayHrs”未定义