Raja Asthana
Raja Asthana

Reputation: 2100

javascript not loading in firefox alone

I have added a piece of javascript code and it is not getting reflected in some of my peer's machine. Don't know whats going wrong.

This is what I did.

  1. OnClick of a button, there was an existing JS function and I added an overlay feature inside the click event like,

    function existing() {
     var testDate = document.getElementById('test');
     ......
     .....
     newOverlay(); // This is the newly added function
    }
  2. I defined the newOverlay() as

    
    function newOverlay(){
    document.getElementbyId('divId').style.display = 'block';
    }
  3. I have defined the new function above the existing() and both the functions are inside the head tag

  4. When I check this change in my local environment, it was working fine and there was no issues. When I deployed to the server, it was working fine for me and my peer could not see the change in firefox. But, he can verify the change in IE and Chrome.

  5. We were thinking of some cache in the browser and we cleared the cache (ctrl+shft+del --> Everything) and tried. The issues occurred again. The part I added was not in the DOM itself. We tried Ctrl+F5, but it was not helpful.

When we reset the firefox browser and tried, the change got reflected and it was working fine. Don't know what was exactly happening. The issue is still occurring in some of our machines. Kindly share your thoughts.

Note: The entire JavaScript is inside a JSP and all are using the same version of Firefox (latest)

Upvotes: 1

Views: 303

Answers (1)

brbtsl
brbtsl

Reputation: 332

Try double quoting in the getElementById(). "id_name" instead of 'id_name'. Sometimes browsers are prone to this kind of bugs.

Upvotes: 1

Related Questions