I inserted javascript code in a Sharepoint 2013 wikipage, through Embed Code.
The basic javascript code appends rows to a table, the code is
var myTable= document.getElementById('myTable');
myTable.innerHTML += myRecord;
Where variable myRecord contains the html code for the row to be appended, the html code is something like
<tr><td>my cell</td><td>my cell 2</td></tr>
The code works as expected and appends the rows to the table 'myTable'.
But when I hit refresh to reload the SharePoint 2013 wikipage, all the rows added programmatically through the javascript are gone
Kindly suggest how to dynamically add HTML content and make it persistent, so the dynamic HTML content don't disappear on page reloads. I know I could save it in local storage and retrieve it or try cookies or session, but its not feasible because the table will have a couple of thousand records or much more.
So I just want to ensure whatever changes I do to the Sharepoint 2013 wikipage's HTML code, through javascript, remain saved or persistent.
Some references I found are as follows, but since I am new to sharepoint I am unable to understand clearly, a detailed step by step instruction would be nice
Programmatically editing Sharepoint Wiki content
Was able to replicate save button using CoreInvoke('PageActionClick', this), but the save button default functionality toggles between save and edit, I only want the save functionality.
Some better references I found online
http://sharepointace.blogspot.com/2013/05/add-custom-buttons-to-edit-or-save.html https://sharepoint.stackexchange.com/questions/88456/assign-edit-fuctionality-to-a-custom-button