!$.support.opacity -- 服务器上的行为与本地主机不同

!$.support.opacity -- different behaivor on server than localhost

本文关键字:主机 support opacity 服务器      更新时间:2023-09-26

我有一个在MVC4中开发的视图,它使用以下客户端JavaScript使用jquery-1.10.2.min.js lib来查看用户的浏览器是否可以执行某些操作,以便我们知道在使用 http://www.plupload.com/时如何处理它们。

我正在运行IE 10.0.9200.1671,当我通过VS在本地运行MS Cassini服务器的Windows 7 PC上运行此代码时,我的customRuntime不是"html4",这是我所期望的。 但是,在同一浏览器中使用其他选项卡并指向运行MS IIS8的测试和QA Windows 2012服务器中此代码的相同版本,它显示customRuntime为"html4"。

    $(document).ready(function () {
        var customRuntime = 'gears,html5,flash,silverlight,html4';
        //Check to see if browser is IE and version is 8 and less, if so set the runtime to Html4 for plupload.
        if (!$.support.opacity) {
            /* IE 6 to 8 */
            customRuntime = 'html4';
        }
        $('#pickfiles').click(function () {
            $('#help2,#help3,#help4').hide();
            $('#help1').show();
            $('.file.failed').remove();
        });
        uploader = new plupload.Uploader({
            chunk_size: '1500kb',
            multipart: true,
            runtimes: customRuntime, //'gears,html5,flash,silverlight,html4',
            browse_button: 'pickfiles',
            container: 'ulcontrol',
            max_file_size: '500mb',
            url: 'ProcessUpload',
            //  resize: { width: 320, height: 240, quality: 90 },
            flash_swf_url: '/assets/plupload/plupload.flash.swf',
            silverlight_xap_url: '/assets/plupload/plupload.silverlight.xap',
            filters: [
                { title: "Data Files", extensions: "zip,csv" }
            ],
            multiple_queues: false
        });
        uploader.bind('Init', function (up, params) {
            $('#runtime').html(params.runtime + " runtime");
        });
        uploader.init();
        ...

同样,在同一个浏览器中,当指向我的本地服务器时,我得到"html5 运行时",在指向测试和 QA 时得到"html4 运行时"。 我已经在服务器上查找了丢失的文件/库,并且代码看起来已完全部署。 我的上传在所有环境中都能正常工作,但我期望的一些HTML5好东西没有发生,而且我发现IE 10的报告因站点而异很奇怪。

我的主要问题是,当在同一浏览器中呈现时,此客户端代码的行为有何不同?

提前谢谢。

我们遇到了类似的问题,我们必须将以下标题添加到 html 文档中

IE10 在 IE7 模式下呈现。如何强制标准模式?