I have a site that has a form that I want users to be able to bookmark and that will work offline with the data they provide and also be able to create new bookmarks based on a change in form data that will be able to be created and used offline.
Imagine something like this:
<textarea></textarea>
<input id="save" type="button" value="save" />
<input id="go" type="button" value="go" />
JS:
$('#save').click(function() { document.location.hash = $('textarea').val() });
$('#go').click(function() { /* create DOM structure based on textarea data */ });
This works great but the problem is I want to also be able to serve people with js disabled.
Now if I use the hash, I lose PHP access, but if I use document.location.search the page will reload and it’s no longer usable offline for those using js, is there anything I can do to cover everyone?
Thou canst catch onsubmit event: if user has js enabled, do your hash stuff and cancel submission; if there’s no js involved, php gets chance. Like this
Will that do?