Forum Moderators: open

Message Too Old, No Replies

#include virtual problem - work in IE6+ but not in Firefox

#include virtual problem

         

djminmin

4:04 am on Jan 12, 2009 (gmt 0)

10+ Year Member



Hi

I would like to include a servlet (a dropdown menu) to a html page.
With this <!-- #include virtual="/pulldown_menu.do" --> added, it works perfectly in IE, but it result with unusual characters in Firefox.

It may due to encoding problem, so i have make sure that all pages are set in UTF-8.
in Html - <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
in pulldown_menu.jsp - <%@ page contentType="text/html; charset=UTF-8" %>

But the problem still exist.

Could anyone give me a hand on this?~

Thanks~!

coopster

8:27 pm on Jan 14, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, djminmin.

Your included file is returning that content type, but what about the actual file it is included within? What headers are reported by Firefox? The LiveHttpHeaders extension will be handy in troubleshooting.

janharders

10:41 pm on Jan 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yeah, the problem is most likely that your http-headers are not reporting utf-8 ... as far as i remember, internet explorer would use the meta http-equiv-data, while firefox will ignore that and go with the one supplied in the http headers.

try adding


AddCharset utf-8 .htm

to your .htaccess and see if that helps (adjust .htm if your file extension, of the one where you include stuff, is different, e.g. .shtml).

jdMorgan

10:54 pm on Jan 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will need to define the MIME-type for .do files "e.g. pulldownmenu.do" in your server configuration.

Jim