Html page edited by the server after upload? - html

It's a continuation of this post : What throws Internet Explorer into quirks mode? .
I have a webpage, built on Django LFC CMS ( http://snow4life.pl/ ). Problem is that when I upload my files to server, the default templates (http://bitbucket.org/diefenbach/lfc-theme-1.0/src/tip/lfc_theme/templates/lfc/base.html) are somehow edited by the server and some random whitespaces are added before the DOCTYPE declaration. The declaration itself is moved somewhere in the <body> segment. This of course throws internet explorer into quirks mode. This is not the templates fault, as on the demo page it is working normally ( http://demo.django-lfc.com/). Do you have any ideas what can cause this ? I've tried uploading empty html pages, samples from w3c, editing it in hex mode and nothing works.
EDIT
I'm uploading via WinSCP. Here are the screenshots from edits in vi on server, winscp's editor on server, vim on my local disk and vi(hex) locally.

You can always force ie to run in standards mode :
<meta http-equiv="X-UA-Compatible" content="IE=8" />

Related

CSS not displaying properly in Sharepoint on Edge Browser (SEC7111 Error)

Hopefully I can explain this correctly. I have recently been moved to a Windows 10 VM from Windows 7 and I'm trying to get a site for my team at work to display properly in Edge. I have a WebPart linking to CSS that is displaying everything as one large list instead of a table with dropdowns. When I open the HTML page on its own in Edge it displays fine, but with code in SharePoint it is not working correctly. Any ideas of why this could happen?
What should display
What is displaying in SharePoint
EDIT
After opening developer tools I find that I am receiving a SEC7111 error code on my CSS file that is being linked. Looking other places for solutions to this too, but any help is greatly appreciated!
FINAL EDIT
With the SEC7111 error I found out that the "file://" links I used for the CSS weren't going to work because they weren't considered "secure" (Although I got the same error in IE, but never had this display issue..?) So, I moved my linked CSS file to a secure folder in another SharePoint site I have, linked the CSS from there, and now it's working!
There are some ways that you can use to solve your problem (It's better to share your code within your question to get a better answer). So, I offer you below solutions:
Solution 1
Please don't use file:// for the published site in the webserver. HTML rendered on the client so you cannot access the local files. so you should not use the file://. you can read more about security concerns and more details on the file protocol here: (https://en.wikipedia.org/wiki/File_URI_scheme)
Instead of using local file protocol, you can use the Absolute/Relative path to your CSS on the HTTP/HTTPS protocols
Solution 2
Add X-UA-Compatible meta tag or HTTP response header to force IE to run with legacy document mode: 5, 7, 8.
X-UA-Compatible meta tag:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
...
</head>
<body>
</body>
</html>
X-UA-Compatible HTTP response header:

HTML not displaying correctly on network drive

I am using HTML to create some automatically generated test reports for work. The reports display fine when they are stored locally on my C:\ drive, but when I copy the report to a work network drive for general access the html doc no longer displays correctly in IE9:
Where there should be a figure with an SVG file displayed, the page just ends (i.e. none of the subsequent content is displayed).
Formatting of things such as figure captions gets messed up.
The reports consist of figures which are relative path linked SVG files stored in the same folder as the HTML doc.
I'd really appreciate any pointers anyone could give on why there is this difference when viewing from a network drive as opposed to my local C:\ drive.
Many thanks
Ben
The IE document mode can be different depending where the file is stored. For example, it can set Mode IE7 for all intranet pages. The same can occurs if you're on another drive.
Because SVG is supported since IE9, a IE8- document mode can remove this support.
Check in the IE dev tools (F12) if there is a document mode difference between each drive or add this meta to force IE to the edge mode :
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<![endif]-->
Try adding this in head section
<meta http-equiv="X-UA-Compatible" content="IE=9">
For more details please refer here
OR
You can add 100% width to parent element, which does some magic.

DOCTYPE HTML not start my webpage on the localhost with console IE message

I´m tryng to run my webpage containing basics scripts <?php..?>,<script>...</script>, in LOCALHOST server, using Apache2triad.
It happens that script are running only to find <!DOCTYPE...> or without it in the IE console, the messages are sending like:
HTML1300:Navigation occured.
HTML1527: DOCTYPE expected. Consider adding a valid HTML5 doctype: "<!DOCTYPE html>".
I already try to use declaration, like:
<!DOCTYPE HTML>
<html>
<body>
<?php echo "Ok, running...."; ?>
or simply:
<html>
<body>
But the console error problem persist... Have you got some idea whats is happening with the server?
Thanks.
Your problem is IE compatibility (it has nothing to do with Apache):
How to use Compatibility View in Internet Explorer 9
You can try to add X-UA-Compatible meta tag:
(it also fixes some layout issues that occur in IE10):
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
A quote from Mozilla's Quirks Mode:
The DOCTYPE shown in the example, , is the simplest
possible, and the one recommended by HTML5. Earlier versions of the
HTML standard recommended other variants, but all existing browsers
today will use full standards mode for this DOCTYPE, even the dated
Internet Explorer 6. There are no valid reasons to use a more
complicated DOCTYPE. If you do use another DOCTYPE, you may risk
choosing one, which triggers almost standards mode or quirks mode.
How do you see which mode is used?
In Internet Explorer, press F12, and look for Document Mode.

Document mode defaults to 8, though using IE11. Why?

I have a problem that my webpage does not display as i wish it to do.
When opening the F12 developers tool in IE11 it says "Document mode: 8 (Default)".
If i change it to mode 9 or higher the page displays as i want it to do.
My code is included in the host web page through an Iframe. I do unfortunatly not have access to edit the host code. The host code includes the code:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
I thought this code would ensure that the code was not shown in document 8? The code is included at the end of the head tag, with 88 lines of code in front of it. Could this be what is causing it to use document mode 8? How can i work around this when i am not able to edit the head code?

IE 11 Browser and Major Version change and Meta tags

I'm working on an ASP.NET website. I have a function where I detect the Browser Name and Version to redirect old browsers to an unsupported website.
I'm using the HttpContext.Current.Request.Browser to pull out the 'Browser' and 'MajorVersion' from it.
When I run it from Visual Studio and it runs locally, Internet Explorer 11 comes in as
Browser: internetexplorer
MajorVersion: 11
But when I publish it out to our server, it comes in as
Browser: ie
MajorVersion: 7
All of my layout pages used by the individual razor views have the meta tag:
<meta http-equiv="x-ua-compatible" content="IE=edge" />
I don't know why it comes in as a different Browser when I publish this to our dev servers and works fine when running it locally.
The other thing, when I F12 in Internet Explorer, the Compatibility Mode is 7. This changes on its own.
Any ideas on how to resolve it.
If it helps, I've added these tags to the web.config files too in the project to include these meta tags.
Thanks!