簡體   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