offer fileupload and comments
This commit is contained in:
+16
-1
@@ -29,4 +29,19 @@ $( function () {
|
||||
shouldDisplay ? $( element ).fadeIn( 750 ) : $( element ).fadeOut( 750 );
|
||||
}
|
||||
};
|
||||
} );
|
||||
} );
|
||||
|
||||
function uploadFile(file, foreignID, tablename, callback){
|
||||
var url = 'index.php/utils/fileupload/upload/' + foreignID + '/' + tablename;
|
||||
var xhr = new XMLHttpRequest();
|
||||
var fd = new FormData();
|
||||
xhr.open("POST", url, true);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
fd.append("userfile", file);
|
||||
|
||||
xhr.send(fd);
|
||||
}
|
||||
Reference in New Issue
Block a user