[英]Showing Value in console.log
我該如何制作才能在console.log()
顯示inputName
的值。 我目前一無所獲 - 我錯過了什么?
代碼:
$(function(){
$.fn.editable.defaults.mode = 'inline';
var inputName = $(this).data("title");
$('.updateField').editable({
type: 'text',
url: '/post',
pk: 1,
placement: 'top',
title: 'Enter public name',
toggle:'manual'
});
$('.edit').click(function(e){
e.stopPropagation();
console.log("inputName");
$('.updateField').editable('toggle');
$('.edit').hide();
});
$(document).on('click', '.editable-cancel, .editable-submit', function(){
$('.edit').show();
})
//ajax emulation. Type "err" to see error message
$.mockjax({
url: '/post',
responseTime: 100,
response: function(settings) {
if(settings.data.value == 'err') {
this.status = 500;
this.responseText = 'Validation error!';
} else {
this.responseText = '';
}
}
});
});
刪除引號: console.log(inputName);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.