I have used Javascript and sharepoint client object model to add a list item to a list. I am working with a sharepoint 2013 online public site. I have a content editor with the following javascript code.
var clientContext = new SP.ClientContext.get_current();
var web = clientContext.get_web();
var list = web.get_lists().getByTitle('Subscriptions');
var email = document.getElementById('email').value;
// Create a new list item
var itemCreateInfo = new SP.ListItemCreationInformation();
var listItem = list.addItem(itemCreateInfo);
listItem.set_item('Title',email );
listItem.update();
This code works fine for the user who has permission. it will add a element to the subscription list. But it fails when we use this for a Anonymous user. After searching I found that that there is a tool : http://anonymous365.codeplex.com/.
But it did not work from the code though i gave anonymous access to the list.
Please suggest me a way to overcome this.
Thanks,