views:

59

answers:

1

Hi,

I've been designing a website and when testing it I normally run it by either double clicking on the file or pressing "play" and running through a browser via Internal Server using Aptana Studio.

Earlier I downloaded XAMPP and browsed the web page using Apache, and i've noticed some changes. Why would running it through Apache make the content differ? It's random things like the centering of a dynamic img or a title not being shown in a custom jQuery popup, where they would act as they should when just browsing using the File. Can anyone shed any light on why it would differ?

Thanks, Donald

+1  A: 

I guess you are developing a xhtml/xml compatible webpage. Apache transmits a content type with your document, most likely the right one. A .html file loaded from the disk is always assumed as text/html. This can lead to subtle differences in the rendered page.

Check if the content type and rendering mode (quirks or strict) in your browser differ when loading from different sources.

Create a minimal file with a xhtml doctype and load it once with .html and .xhtml file extension and compare the content type.

ebo
Thanks. When loaded from disk would it be assumed as text/html even when I have specified a doctype?
Fermin
Yes. File extension is preferential.
ebo