【问题标题】:!$.support.opacity -- different behaivor on server than localhost!$.support.opacity - 服务器上的行为与 localhost 不同
【发布时间】:2013-11-19 19:15:40
【问题描述】:

我有一个在 MVC4 中开发的视图,它使用以下客户端 JavaScript 使用 jquery-1.10.2.min.js 库来查看用户的浏览器是否可以执行某些操作,因此我们知道在使用时如何处理它们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 的报告因站点而异,这很奇怪。

我的主要问题是这个客户端代码在同一个浏览器中呈现时会有什么不同?

提前致谢。

【问题讨论】:

  • 您是否处于兼容模式?
  • 可能是兼容性视图问题?检查页面在 test/qa 服务器上查看时是否触发兼容性视图。

标签: javascript jquery internet-explorer iis browser-support


【解决方案1】:

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

IE10 renders in IE7 mode. How to force Standards mode?.

【讨论】:

    猜你喜欢
    • 2012-06-28
    • 1970-01-01
    • 2011-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-20
    • 1970-01-01
    相关资源
    最近更新 更多