-2
$(document.body).on("click",'.sub-unfollow', function(){
var unfollow_tag = {element:"",un:"",type:"",text:""};
var unfollow_tag.element = $(this).parents("li");
var unfollow_tag.un = $(this).parents("li").attr("data-un");
var unfollow_tag.type = $(this).parents("li").attr("data-type");
var unfollow_tag.text = $(this).parents("li").text();
alert(unfollow_tag.text);
});
使用此看似基本的對象設置獲取錯誤。有任何想法嗎?JavaScript對象使用點符號的錯誤
你得到的錯誤是什麼? – Tushar
「出錯」,出現什麼錯誤? –
實際上並不確定,但是當這段代碼存在時,我的頁面上沒有運行js。它只在我刪除所有對unfollow_tag對象的引用時纔開始工作 –