Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Issue on Firefox with executeQueryAsync call

$
0
0

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

functionAddMailBoxItems(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



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>