jQuery的文件上传不IE9时,COM pressed与Requirejs工作 [英] jQuery File Upload doesn't work in IE9 when compressed with Requirejs

查看:323
本文介绍了jQuery的文件上传不IE9时,COM pressed与Requirejs工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的code使用与骨干和Requirejs jQuery的文件上传以及完美的作品在IE 9的时候我直接访问开发code(无建筑物)。当我建立它出了问题,并请求被发送空到服务器。

My code uses Backbone with Requirejs and jQuery File Upload and works perfectly in IE 9 when I access the development code directly (without building). As soon as I build it something goes wrong and the request is sent empty to the server.

我在请求(使用网IE9捕捉)看到的唯一区别是,当我在上传按钮单击的工作之一,发起人是点击,和失败的人,发起者是 JS库XMLHtt prequest

The only difference I see in the request (using Network capturing in IE9) is that the one that works when I click in the upload button, the Initiator is click, and for the one that fails, the initiator is JS Library XMLHttpRequest.

所以,一定有什么东西使得事件的变化时,code获得COM pressed,但我不知道怎么去接近问题的根源。

So there must be something making the event change when the code gets compressed, but I have no idea how to get closer to the root of the problem.

任何想法?

推荐答案

您要求的的iFrame插件运输

我使用jQuery文件上传与Requirejs,并没有看到这个问题。如果没有看到一些code,这是很难说是什么绊倒了您的应用程序。我建议用一些有关code更新你的问题。在此期间,这里是什么,是为我工作。

I am using jQuery File Upload with Requirejs, and have not seen this issue. Without seeing some code, it is hard to say what is tripping up your application. I suggest updating your question with some relevant code. In the meantime, here is what is working for me.

main.js

require.config({
    appDir: '../',
    baseUrl: 'js/',
    paths: {
        underscore: '../vendor/lodash.underscore',
        backbone: '../vendor/backbone',
        'jquery.fileupload': '../vendor/jquery-file-upload/js/jquery.fileupload',
        'jquery.iframe-transport': '../vendor/jquery-file-upload/js/jquery.iframe-transport',
        'jquery.ui.widget': '../vendor/jquery-file-upload/js/jquery.ui.widget'
    },
    shim: {
        underscore: {
            exports: '_'
        },
        backbone: {
            deps: ['underscore', 'jquery'],
            exports: 'Backbone'
        }
    }
});

和中,里面的上传控件的页:

And in the page that houses the upload control:

UploadPage.js

define([
    'views/Base',
    'jquery.iframe-transport',
    'jquery.fileupload'
], function(BaseView) {
    return BaseView.extend({
        // Do cool stuff
    });
});

这篇关于jQuery的文件上传不IE9时,COM pressed与Requirejs工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆