My code executes if the console window is opened for atleast one time in IE 11 otherwise not running.
I found various articles and posts stating removing "console" object and/or disabling cache during ajax calls will prevent this issue. But in my code there is no ajax calls nor console objects. Still the problem persists.
Below is the as usual code for inserting item which works if console is opened.
...
...
var list= webSite.get_lists().getByTitle('listname')
var listItemInfo = new SP.ListItemCreationInformation()
var listItem = list.addItem(listItemInfo)
...
...
listItem.update()
clientContext.load(listItem);
clientContext.executeQueryAsync(function () {},function () {});
Couldn't understand the actual reason for this behaviour. Have anyone faced this behaviour before.
Is there any way to stop this issue.
Side Note :
If I modify the source code like adding alert(), my code runs for the first time, but next time onwards the same issue. So I guess there must be some type of caching issue.