ie 9 shows different renders of the same html file - html

My problem is this: I have two duplicates of an index.html page that render differently in IE 9, depending on if the file is on an exteral USB drive or the native harddisk drive! It is driving me nuts and the only difference is where the file is. The page is properly structured and has a doctype 5 declaration. Chrome and Firefox have no problem.

Most likely explanation: In one case, it's running in Standards Mode because it's in the Internet Zone, and in the other it's running in Compatibility View because it's in the Local Computer zone.
There's likely a hidden alternate data stream ("Mark of the Web") on the file that's causing this. http://blogs.msdn.com/b/ieinternals/archive/2011/03/23/understanding-local-machine-zone-lockdown-restricted-this-webpage-from-running-scripts-or-activex-controls.aspx

Related

Chrome 66 shows HTML code instead of rendering

I have a HTML file that renders correctly in Chrome 66 when the file extension is ".html", so I know that the code if fine.
However, the process that generates the code defaults to an extension of ".DAT" and there isn't a way to change it. Also, I tried associating ".DAT" with Chrome, but the page still shows code instead of rendering.
When I was using an older version of Chrome (50 something) it was rendering the pages properly. How can I get ".DAT" files to render correctly in my newer version?
I have the same behaviour today with one of our users.
Some DAT files with html coding are displayed as loose html code instead of being rendered.
If I open it in IE it works fine.

IE Display Data URI

I'm currently using a solution which converts a pdf file to a data URI. The data URI is then set as an iframe's source and displays the pdf on almost every major browser, I have learned that IE 11 does not like this though. After reading up on it, i realize that iframes don't support data URI's as the source (nor do any elements other than an image URI) and that I can't set a source for an element so I'm unsure how I could achieve the same with Internet Explorer.
I've tried using an embed (learned that it doesn't like data URIs either), an iFrame, initiating a download in a new tab of the file itself (to mimick viewing a it in the browser - no avail) and I'm running out of ideas but unfortunately a lot of people still use Internet Explorer so I'd like to make it compatible. Is there any way to recreate this behavior in Internet Explorer like other browsers do?
Thanks in advance :)
I ended up giving up on this for lack of time to research/test. The final solution was just as well I suppose. I ended up writing the PDF to subdirectory in the website and then setting the source ofthe iframe to the download method of the file. Tad slower than my original implementation but it works for legacy purposes. When will IE die!

PDF not opening in my browser in production

I have a Razor MVC application that contains a link to open a PDF stored on a file server. My code works when I run it in Visual Studio but is not working when I try it on production on the same computer. I click the link and nothing happens, I can see the path when I hover over it though. There are no errors or anything. I've tried all browsers but only really care about IE.
View
Image when I hover over the link
Any ideas why this is not working?
Filesystem URLs from remote pages (i.e. pages on other protocols like http:// or even other directories in the file system) are blocked by modern browsers for security reasons.
Here is a page describing the behaviour for Firefox (along with reasons why it exists).
Internet Explorer has joined the ranks of these modern browsers:
By default, Internet Explorer prevents navigation to Uniform Resource
Identifiers (URIs) using the "file:" protocol when the current URL
matches the following conditions:
The current URL is opened in the Internet zone or the Restricted Sites zone.
The current URL uses a protocol other than "file:".
This is a security measure designed to
prevent malicious sites from accessing system file objects.
This can be changed, but only on a per-client basis (see the MSDN article for details.)

Local IE rendering

So I have an interesting quirk that isn't making a lot of sense right now.
I am trying to create drop down menus for a website using CSS.
When I open the index.html file locally, it looks fine in Firefox, and it is all messed up in IE.
When I FTP the file to a server, it looks fine in both Firefox and IE.
I would like to be able to see what it is supposed to look like in IE locally, before uploading it to the actual site.
What would cause IE to render incorrectly on the local file, but correctly on a server?
For some reason, IE9 (and possibly 10, I'm not sure) runs Intranet sites in Compatability Mode, and it defines all locally viewed HTML files as intranet pages. So, when you're accessing local files, you may very well be accessing them roughly as if you're viewing in IE7.
Turning this off has been covered here.

Firefox doesn't show images from a local file path

I have used <img> tag in html for displaying images. The image gets displayed in Internet Explorer 10, but it is not visible in mozilla, chrome. Could someone please tell me the reason why?
<img src="file:///d:/maruthi.jpg" style="width: 150px; height: 140px;" alt="Photo">
Chrome stops access to local file:// links from with in http:// page for security reasons by default.
file:// is not allowed in Chrome and Firefox for security reasons by default, but this answer shows you how to change those settings. Really, you should set up a lightweight local server.
The <img> tag is standard across all browsers (except text-based browsers like Lyx). That should work, however given that it is a local path it may be that you are testing it in a different environment that can't access that path?
Review this wikipedia page on the file URI scheme and it will also highlight that some browser will limit access to local files for security reasons.
The original title to OP's question is NOT misleading - it is perfectly valid. However, they did not say whether they were using Windows or Linux. Windows and Windows programs (like DOS from which they originated) are completely indiscriminate with regard to the use of upper or lower case in filenames.
Two possibilities to consider:
Linux is fully case sensitive, including its use of filenames. Yourfile.JPG is NOT recognized as being the same as Yourfile.jpg! I recently migrated from Windows to Linux and encountered exactly the same problem with Firefox. It displayed images in sites on the internet, but not in perfectly valid local HTML and CSS markup. Later, I noticed that the Windows image-editing program I'd been using had saved all the images with uppercase .JPG or .PNG extensions. A few that I'd previously renamed manually had lowercase extensions - these DID display normally! Linux 'properties' for those files identified them correctly as JPEG files, while those with uppercase extensions were simply identified as IMAGE. Also, my markup references all images with lowercase extensions (professional usage). When non-displaying image file extensions were changed to lowercase, they all displayed correctly.
If Steve is still using Windows, it's possible that Internet Explorer is displaying local images for the same reason as above. Firefox, though, uses a different engine (Mozilla) and, being open-source, maybe more strict with regards to case sensitivity in file names. However, I'm not in a position to check this out. Maybe someone else can test.
i have used in jsp as this : and working in firefox and chrome
<a href="Welcome.jsp"><img src="home.jpg">