aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Extraneous Firefox (Mozilla) server requests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Extraneous Firefox (Mozilla) server requests" Watch "Extraneous Firefox (Mozilla) server requests" New topic
Author

Extraneous Firefox (Mozilla) server requests

Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
I'm not that familiar with Firefox, but I was asked to look at an issue with Firefox for the application I am working on. It seems that once a user displays some pages in the application, clicking on a link in the page will display not only the requested page but also pop up a new window containing the message: Error 404 Servlet Not Found [object Event].

This is an issue in Firefox 2.0.0.6 and Netscape 9 only. IE 6 SP2 and Opera 9.23 do not have the problem. I have monitored the HTTP requests in IE using HTTP Watch and in Firefox using Live HTTP Headers. In Firefox, I see additional requests similar to:

https://www.mysite.com/context/servlet/%5Bobject%20Event%5D

being made. However, I have no clue as to what "[object Event]" is. I have examined the problem pages thoroughly but do not see any HTML and/or JavaScript that would account for this request.

The only ideas I have at this point are 1) it's a Firefox/Mozilla security setting issue or 2) it's problem with the HTTP server (we are using Microsoft-IIS/5.0 as the front-end HTTP server for WebSphere 5).

I'm not sure this is the proper forum but I'm desperate for ideas.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Looks a whole lot like a JavaScript boof-up to me. Are you sure that there's no JS on the page? Particularly submit handlers?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
The extraneous requests are triggered by clicking on links similar to the following (and occasionally, for reasons unknown to me, just by dragging the mouse across the page):



I don't really see a problem with that anchor tag other than it does not contain and end tag.

To clarify, the page DOES CONTAIN JavaScript but not very much, mostly to open display windows such as following function (invoked above).



However, after reviewing the code once again, I have discovered there are TWO functions named "openwindow" so perhaps that is what is causing the problem. I am pursuing that possibility now.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Originally posted by Jay Damon:
I don't really see a problem with that anchor tag other than it does not contain and end tag.
Well, that is a big problem. Malformed HTML is almost guaranteed to cause issues. Without a closing tag, how does the browser know where the link stops?

If all you are trying to do is to execute some JS, why have a link at all? Use an appropriately styled <span> with an onclick handler. That way you avoid unintended semantic actions.

However, after reviewing the code once again, I have discovered there are TWO functions named "openwindow"
Until your JavaScript and HTML are properly formed, chasing any problems is fruitless. The problems may just go away when you fix your page, but if not, at least any issues caused by problem code is eliminated.
[ September 26, 2007: Message edited by: Bear Bibeault ]
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 282
Bear,

Thanks for the response. However, you're preaching to the choir. The application I am working on is over 10 years old. To give you some perspective, I've seen references in the code to Internet Explorer 2. Heck, I didn't even know there was an IE 2.

Trust me. I completely agree with your comments. You cannot imagine how much malformed HTML, browser-specific JavaScript, etc. I have already corrected. Unfortunately, it takes time to turn application like this around and there is always the inevitable resistance to changing "what works."

Thanks again for your help though. I think I may finally be on the road to a solution.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Originally posted by Jay Damon:
there is always the inevitable resistance to changing "what works."
Well, in this case you have a pretty strong argument for "not working". At least part of the fix is to eliminate the sloppy code. They can't argue with that. (Well, I guess they could, but not reasonably).
 
Consider Paul's rocket mass heater.
 
subject: Extraneous Firefox (Mozilla) server requests