0
$(document).ready(function () {
    $('#upload_photo').click(function () {
        $('input[type=file]#upload_myphoto').click();
    });
});
$(document).ready(function () {
    $("input[type=file]#upload_myphoto").change(function () {
        $("#node_profilepic").prop('src', 'loader.gif');
        $("#upload_profilepic").submit();

    });
});
$(function () {
    $('#upload_profilepic').ajaxForm({

        beforeSubmit: ShowRequest,

        success: function (responseText, statusText) {
            alert(responseText);
            //$("#node_profilepic").prop('src',responseText);
            $('.iframe').click();
        },
        error: AjaxError
    });
});

function ShowRequest(formData, jqForm, options) {
    //alert(formData);
    var queryString = $.param(formData);
    // alert(queryString);
    return true;
}

function AjaxError() {}

This code is used for uploading the image using Ajax call and it will work on all the browser except IE. Please tell me i can call the Ajax form using IE

Spudley
  • 166,037
  • 39
  • 233
  • 307
user3277953
  • 5
  • 1
  • 4

1 Answers1

0

Try to use setTimeout() for IE like,

$(function(){
    $('input[type=file]#upload_myphoto').change(function () {
        setTimeout(function(){
            $("#node_profilepic").prop('src', 'loader.gif');
            $("#upload_profilepic").submit();
        },100);// you can try 0 in place of 100
    });
});

Read Inconsistent change event in IE and Jquery: change event to input file on IE

Community
  • 1
  • 1
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106