我有一个header.js,其中包含以下内容:

var auto_refresh = setInterval(function () {
        var theToken = $('#token').text();
        $('#error-div').text('');
        $('#load_me').load("http://localhost:8080/sc_demo/tasklist.jsp?app=Home&process=tasklist&userToken="+theToken
            ).fadeIn("slow");                
}, 30000); // autorefresh the content of the div after every 3000 milliseconds(30sec)

现在,它加载的页面,“tasklist.jsp”被加载到当前页面的div中,应该每30秒刷新一次 . tasklist.jsp具有需要服务的“click”事件,并由header.js中的click事件处理 . 为了使这些工作,即使tasklist.jsp被加载到已经包含header.js的页面中,我必须在tasklist.jsp中包含header.js . 然而,这会导致级联重载 . 我该如何防止这种情况?是否真的不可能尝试重用代码?为什么我需要包含header.js,如果它应该已经在我加载我的部分的页面中?