im creating SObject("Attachment") the problem is depends on how big is the file usually it take some amount of seconds do get the results. I want to find a away to alert me when the result comes back so i can stop the spinner.
<script src="/soap/ajax/34.0/connection.js" type="text/javascript"></script> <script> var AttachmentList = []; var att = new sforce.SObject("Attachment"); att.Name = this.file.name; att.ContentType = this.file.type; att.Body = (new sforce.Base64Binary(e.target.result)).toString(); AttachmentList.push(att); var attachmentListJSON = JSON.stringify(AttachmentList); console.log('attachmentListJSON'); console.log(attachmentListJSON); </script>