Alternative for windows.url in safari

Is there an alternative for

window.URL = window.URL || window.webkitURL;

for Safari 5 and below ?? I am trying to view an image uploaded by a user using the following snippet:

var file = jQuery('#brandImageUpload').prop("files")[0];
window.URL = window.URL || window.webkitURL ;
var blobURL = window.URL.createObjectURL(file);
$('#ibrandImage').attr('src', blobURL);
$('#brandImage').slideDown();
$(this).slideUp();

But window.URL returns undefined.

+4
source share
1 answer

According to this feature, it is simply not supported by Safari 5.1 and below. http://caniuse.com

It is important to understand that it is not supported by IE9 or lower, Opera Mini and some other small desktop and mobile browsers. Therefore, it is probably best not to use it.

0
source

Source: https://habr.com/ru/post/1613473/


All Articles