繁体   English   中英

在 console.log 中显示值

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM