相关疑难解决方法(0)

日期构造函数在IE中返回NaN,但在Firefox和Chrome中有效

我正在尝试用JavaScript构建一个小日历.我的日期在Firefox和Chrome中运行良好,但在IE中,日期函数返回NaN.

这是功能:

function buildWeek(dateText){
    var headerDates='';
    var newDate = new Date(dateText);

    for(var d=0;d<7;d++){
        headerDates += '<th>' + newDate + '</th>';
        newDate.setDate(newDate.getDate()+1);
    }                       

    jQuery('div#headerDates').html('<table><tr>'+headerDates+'</tr></table>');
}
Run Code Online (Sandbox Code Playgroud)

dateText是本周的星期一,它实际上是以'm,d,Y'的格式在php中设置的,例如"02, 01, 2010".

javascript internet-explorer date

78
推荐指数
4
解决办法
12万
查看次数

Blue Imp jQuery文件上传 - IE8 data.submit()未触发

我正在使用Blue Imp jQuery File Uploader将文件上传到MVC控制器.这适用于所有浏览器,除了Internet Explorer 8,其中data.submit()似乎没有被触发.我已经为'data'添加了一个监视器,我可以在那里看到该文件,但是表单根本没有被提交.下面是我的插件代码的精简版:

$('#fileupload').fileupload({
    dataType: 'json',
    url: "Upload/Index",
    limitConcurrentUploads: 1,
    sequentialUploads: true,
    add: function (e, data) {
        var filename = data.files[0].name;
        data.context = $('<div class="progress-container"></div>').text(filename).appendTo      ($('#filelistholder'));
        // Add a progress bar for the file
        $('<div class=\"margin-b-10 progress-halved\"><div class="bar"></div></div>').appendTo(data.context);
        // Add a new click event for the Upload All button and enable it
        $('#btnUploadAll').removeAttr('disabled').click(function () {
            // Submit the file and remove the click event
            data.submit();
            $('#btnUploadAll').off('click');
        });
        // Show how many files have been selected
        $('#overallProgressText').text($('.progress-container').size() …
Run Code Online (Sandbox Code Playgroud)

jquery submit internet-explorer-8 blueimp jquery-file-upload

8
推荐指数
1
解决办法
3293
查看次数