Welcome Guest, Not a member yet? Register   Sign In
file upload with ajaxFileUpload
#1

[eluser]Unknown[/eluser]
I’m trying to upload an image using jquery, the file is successfully upload to the server but i got an error

Uncaught TypeError: Object function ( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
} has no method 'handleError'

beside that error i'm also did not get a message if success or when it failed.

I’m also using ajaxFileUpload: http://www.phpletter.com/Our-Projects/AjaxFileUpload//

My code:

Code:
function addData() {
    event.preventDefault();
//starting setting some animation when the ajax starts and completes
       /*  $("#loading")
        .ajaxStart(function(){
            $(this).show();
        })
        .ajaxComplete(function(){
            $(this).hide();
        }); */
        
    $.ajaxFileUpload({
  url:'<?php echo 'diktaktor/addProduct'; ?>',
  secureuri:false,
  fileElementId:'fil',
  dataType: 'json',
  success: /*function (data, status)
  {
    if(typeof(data.error) != 'undefined')
   {
    if(data.error != '')
    {
     alert(data.error);
    }else
    {
     alert(data.msg);
    }
   }
  }*/
  function(){
   alert('success');
  },
  error: /* function (data, status, e)
  {
   alert(e);
  }*/
  function(){
   alert('error');
  }
});
        
    return false;
//alert('asd');
}




Theme © iAndrew 2016 - Forum software by © MyBB