Click here to Skip to main content
15,885,203 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
I am working on a project where I need to show preview of image before croping.i am using jquery.Jcrop.js v0.9.12 plugin and it works great in all the browsers. but in Safari preview image does not display. I found that in lower version of Safari FileReader is not supported. i have safari 5.1.7. here is the code :
JavaScript
var e = {};
e.pf = window.FileReader && function (e, t, n) {
    var r = new FileReader;
    r.onload = function (n) {
        var r = new Image;
        r.onload = function (n) {
            if (!t.beforePick.call(e, r)) {
                e.setImage(r.src, t.afterPick)
            }
        };
        r.onerror = function (n) {
            t.beforePick.call(e, null)

        };
        r.src = n.target.result
    };
    r.readAsDataURL(n)
};

Do we have any other way to read file in lower version of Safari for window?

Thanks
Posted

Safari 5.x does not support FileReader. It is supported form version 7.1 only...
 
Share this answer
 
Comments
Raje_ 12-Feb-15 10:39am    
Thank you for reply. yes I know it does not support FileReader. do we have any alternative for this?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900