Moment.min.js这个.Format不是一个函数
Moment.min.js this.format is not a funtion
我试图在可编辑中使用组合,然而,当我试图保存moment.min.js说这。格式不是一个函数。这是来自moment。js的代码:
$('#start').editable({
viewformat: 'DD-MM-YYYY',
success: function(result, newValue){
return $.ajax({
url: '/Project/Edit',
data: { id: '1', NewValue: newValue, type: 'StartDate' },
success: function (result) {
if (result.Success == 'Success') {
notify('The Start Date was successfully updated.', 'success');
} else {
notify('The Start Date could not be updated at this time.', 'error');
}
}
});
}
}).on('hidden', function () {
$(this).parent().next().children().removeClass('disabled');
});
这是moment.js中调用的行
toString: function () { return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
moment.js中的这一行在可编辑的成功函数被调用之后被调用。
我明白了。我必须在ajax调用中对newValue调用.format()方法。这就是js给出错误的原因。下面是工作代码:
$('#start').editable({
viewformat: 'DD-MM-YYYY',
success: function(result, newValue){
return $.ajax({
url: '/Project/Edit',
data: { id: '1', NewValue: newValue.format('MM/DD/YYYY'), type: 'StartDate' },
success: function (result) {
if (result.Success == 'Success') {
notify('The Start Date was successfully updated.', 'success');
} else {
notify('The Start Date could not be updated at this time.', 'error');
}
}
});
}
}).on('hidden', function () {
$(this).parent().next().children().removeClass('disabled');
});
相关文章:
- 我可以在json对象中添加一个函数吗
- 如何在JQuery函数中定义一个值,然后调用另一个函数并使用该值
- 是否可以将一个函数输入连接到另一个函数调用的文本
- 在另一个函数中使用变量this
- 在另一个函数成功结束后调用该函数
- mongoose.connect undefined不是一个函数
- 监听器必须是一个函数
- 使用JS函数来使用另一个函数的语法?node.js
- 如何取消object.prototypes javascript的一个函数
- 从Chrome扩展名中的popup.html文件在background.js文件中运行一个函数
- 嵌套到另一个函数中的Fancybox函数;不起作用
- 如何在javascript中使用不止一个函数
- jQuery-在页面加载时执行一个函数
- jquery UI draggable:UI.children不是一个函数
- jQuery Mobile Undefined不是一个函数
- 如何在php中创建一个函数,该函数与文本区域一起工作,通过输入类似[color:red]的内容来打印具有等效颜色的文本
- javascript函数将数据添加到屏幕,但随后被另一个函数覆盖
- JS异常:animate不是一个函数
- 如何将一个函数附加到一个不存在的元素上
- JavaScript/jQuery-添加添加和删除类与下一个函数之间的延迟