2008-12-08 99 views
1

我正在開發使用eclipse和tomcat的.jspfirefox/tomcat/eclipse中.js文件的奇怪緩存

我的.jsp輸出html以從.js文件中拉入一些javascript。 jsp輸出將函數mapTool連接到mousedown事件的代碼。 imfMapFunctions5101.js包含mapTool(e)函數。

當我在Firefox中運行時,我對.js文件所做的更改不會產生影響,雖然它們在我在IE中運行時也會發生。

在.JSP

out.println("<script language=\"JavaScript\" type=\"text/javascript\" src=\"imfMapFunctions5101.js\"></script>"); 

....  

out.println("function startup() {"); 
     out.println(" hideLayer(\"loadMap\");"); 
     out.println(" if (document.layers) {"); 
     out.println(" document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);"); 
     out.println(" }"); 
     out.println(" document.onmousedown = mapTool;"); 
     out.println(" **alert(document.onmousedown);**") //pops up the event code in the browser 

; 
....... 

的JavaScript事件代碼imfMapFunctions5101.js

function mapTool (e) { 
    **alert('mapTool'); //my alert** 

    if (dTools.activeTool == "Drill Down Identify") { 
    showLayer("loadData"); 
..... 

alert(document.onmousedown);在IE瀏覽器彈出我可以看到該事件的代碼與我添加的警報:

function mapTool (e) { 
    **alert('mapTool'); //my alert** 

    if (dTools.activeTool == "Drill Down Identify") { 
    showLayer("loadData"); 

.... 

在firefox中彈出的事件代碼不包含我的警告:

function mapTool (e) { 

    if (dTools.activeTool == "Drill Down Identify") { 
    showLayer("loadData"); 

這就像文件緩存和Firefox堅持讓舊的緩存.js文件。很確定這不是什麼情況。已嘗試更新.jsp時間戳,將JavaScript重命名爲僞造名稱,然後再返回。

發生了什麼事?

任何幫助非常感謝?

回答

3

嘗試刷新頁面wile清除緩存:shift +單擊刷新按鈕或清除緩存下的工具 - >清除私人數據