locked
Issue on Firefox with executeQueryAsync call RRS feed

  • Question

  • I have written ECMA script to add an item into on SharePoint List. I am using ECMA script for the same. Code is given below

    function AddMailBoxItems(to, subject, message) {
    
    
        var clientContext = SP.ClientContext.get_current();
    
        var webSite = clientContext.get_web();
    
        var lists = webSite.get_lists();
    
        var mailBoxList = lists.getByTitle(LIST_HOLIDAY_MAILBOX);
        clientContext.load(mailBoxList);
        var itemCreationInfo = new SP.ListItemCreationInformation();
    
        var listItem = mailBoxList.addItem(itemCreationInfo);
    
        listItem.set_item("Title", subject);
        listItem.set_item(LIST_HOLIDAY_MAILBOX_COLUMN_MESSAGE, message);
        listItem.set_item(LIST_HOLIDAY_MAILBOX_COLUMN_TO, to);
    
        listItem.update();
    
        clientContext.load(listItem);
    
        clientContext.executeQueryAsync(Function.createDelegate(this, this.onSuccees),Function.createDelegate(this, this.onFail));
    
    
    }
    
    onSuccees = function (sender, args) {
    //alert("Success");
    }
    
    
    onFail = function (sender, args) {
        alert('failed to send Email. Error:' + args.get_message());
    }

    The problem is only on FireFox. On Firfox above code does not work and the

    executeQueryAsync response goes to onFail fucntion. 

    The same code works fine on IE and Chrome

    I believe this aysnc call is causing problem here but why only on FireFox?


    Pathik Rawal My Blog


    • Edited by Pathik Rawal Monday, May 13, 2013 8:33 AM subject edited
    Monday, May 13, 2013 8:11 AM

Answers

  • executeQueryAsync reponse goes to onFail function means that it could be something wrong with server side operation, please check your ULS log.
    • Marked as answer by GuYuming Monday, May 20, 2013 5:23 AM
    Tuesday, May 14, 2013 5:43 AM
  • You may also check for error in the error console in Mozilla Firefox.

    Regards,
    SC Vinod
    Blog
    : http://sharesilver.wordpress.com/

    • Marked as answer by GuYuming Monday, May 20, 2013 5:23 AM
    Tuesday, May 14, 2013 6:03 AM

All replies

  • executeQueryAsync reponse goes to onFail function means that it could be something wrong with server side operation, please check your ULS log.
    • Marked as answer by GuYuming Monday, May 20, 2013 5:23 AM
    Tuesday, May 14, 2013 5:43 AM
  • You may also check for error in the error console in Mozilla Firefox.

    Regards,
    SC Vinod
    Blog
    : http://sharesilver.wordpress.com/

    • Marked as answer by GuYuming Monday, May 20, 2013 5:23 AM
    Tuesday, May 14, 2013 6:03 AM
  • I have Faced the same issue,my code is running fine in IE and in Chrome but it is giving error(Function is not defined) in Firefox I did lot of googling but couldn't find anything so what I did is instead of calling the function in executeQueryAsync I directly copy pasted my function in executeQueryAsync,this solved the my issue...
    • Proposed as answer by Sathish Bejjam Wednesday, September 16, 2015 6:07 AM
    Wednesday, September 16, 2015 6:07 AM