首页 > 解决方案 > 标识符已使用 .html(data) 声明

问题描述

每次单击侧边栏的按钮时,此功能都会运行:

function loadContent(event, tabName){
    $("#pane").empty()
    if(event !== undefined && tabName !== undefined){
        oldTabname = tabName
        $("#pane").load(tabName)
    }
    else{
        $.get(oldTabname).done(function(data){
            $("#pane").html(data)
        })
    }
}

but when the tab load, if this tab contains any require inside of the js file equals the last tab it gave the error: SyntaxError: Identifier has already been declared.

有什么方法可以清除 div 窗格?

标签: javascripthtmljquery

解决方案


推荐阅读