Safari 11.1: ajax/XHR form submission fails when input[type=file] is empty

后端 未结 6 692
南笙
南笙 2021-01-30 21:09

UPDATE: As of Webkit build r230963, this issue has been resolved in Webkit.

===========

Since the recent Safari 11.1 update on macOS and iOS, as

6条回答
  •  广开言路
    2021-01-30 21:30

    For workaround I delete the input type file completely from DOM using jQuery remove() method.

    $("input[type=file]").each(function() {
        if($(this).val() === "") {
            $(this).remove();
        }
    });
    

提交回复
热议问题