views:

1165

answers:

2

I'm developing .jsp using eclipse and tomcat.

My .jsp outputs html to pull in some javascript from a .js file. The jsp outputs the code which hooks up the function mapTool to the mousedown event. imfMapFunctions5101.js contains the mapTool(e) function.

The changes I make to the .js file do not take affect when I run in firefox, although they do when I run in IE.

in the .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

; 
.......

The javascript event code in imfMapFunctions5101.js:

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

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

when alert(document.onmousedown); pops up in IE I can see the event code with my added alerts:

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

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

....

In firefox the event code that pops up does NOT contain my alert:

function mapTool (e) {

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

It's like the file is caching and firefox insists on getting the old cached .js file. Pretty sure that's not what happening. Have tried updating the .jsp timestamp, renaming the javascript to a bogus name, then back again.

What's going on?

ANy help much appreciated?

+1  A: 

try refreshing the page wile clearing cache: shift+click on refresh button, or clearing the cache under tools->clear private data

Pim Jager
A: 

THANKYOU!!!!

I've got lot's to learn, but now I know about stackoverflow.....