I have seen many topics with similar portions of this issue but I have yet to find a solution to my exact problem. I have a website developed in Visual Studio Express 2013 for Web. It includes some jQuery 2.2.2 scripts to determine filesize values of selected files. Here is the jQuery:
$(function() {
$('#MiscUpload').change(function () {
if (this.files[0] != null)
{
var f = this.files[0]
if ((f.size || f.fileSize) > 4096000) {
$('#UploadSizeLbl').empty()
$('#UploadSizeLbl').append("File Size: " + ((f.size || f.fileSize) / (1024 * 1024)).toFixed(1) + " MB. Cannot exceed 4 MB. Please reply to your confirmation e-mail with the file or p drive location.")
$('#UploadSizeLbl').css('color', 'red')
$('#UploadSizeTxt').val(null)
$('#MiscUpload').val(null)
} else {
$('#UploadSizeLbl').empty()
$('#UploadSizeLbl').append("File Size: " + ((f.size || f.fileSize) / (1024 * 1024)).toFixed(1) + " MB")
$('#UploadSizeLbl').css('color', 'green')
$('#UploadSizeTxt').val((f.size || f.fileSize))
}}
})
})
This runs perfectly on the local machine in IE11. When deployed from a web server (2012 R2) with IIS version 8.5, the jQuery does not fire in IE 10 or 11, with compatibility mode on or off. It is not specific to this code, there are other .change and .click functions and none of it works in IE. When I run the site in Chrome, everything runs perfectly. IE can execute the code properly, because it works fine when ran locally instead of from IIS. There are no errors, it simply doesn't fire.
I have tried setting X-UA-Compatibility to IE=Edge, also tried IE8 and EmulateIE8 at the IIS level.
How can I get my jQuery to fire in IE from IIS?
EDIT: This is still not working. The server is in Security Zone "Local Intranet". Users by default have "View Intranet Sites in Compatibility Mode" checked. When they are view in Compat. mode the jQuery does not fire. If they uncheck that box the jQuery WILL fire. If they recheck that box, the jQuery will STILL fire.