I am trying to allow for a form to call a java script function without losing javascript dependent data on the page.
This is what I got.
The function is some generic appending function.
I lose of the appended data whenever I change the input string.
I added
window.onbeforeunload = function(){
return false;
}
And it would work as long as I pressed no on all of the popup boxes.
Thank you
Edit: I ahve noticed that it happens wehenever the url name is changed
here is html for good measure
<form method="get" action="#">
<input type="text" id="data" name="post" placeholder="thoughts?" />
<button onclick="appendToBody()">
Post
</button>
</form>
$('form').submit(function() {});?