我在qQuery功能下面有这个功能,它将几个对象设置为null。
$.fn.myfunction = function() {
var newAppointmentDetails = {
AppointmentStatusTypeId: null,
AppointmentStatusId: null,
AppointmentType: null,
CallDate: null,
};
}`
我从 View 文件(单独的文件)中将此函数称为“myfunction”,但出现对象未定义错误。
fn.myfunction();
如何调用此函数?
最佳答案
像这样声明它:
var myFunction = function(){ var newAppointments = ... };
然后,您可以直接调用它:
myFunction()
关于jquery - 如何在 View 模型文件中定义的 View 文件中调用函数-jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32015142/