diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2014-06-07 22:21:02 +0300 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2014-06-07 22:21:02 +0300 |
| commit | f28d277126d971216a3c4cacc07fff4162721e80 (patch) | |
| tree | ceaaa889bc31375ff7af51f49123d9963062da9a | |
| parent | fd770a171d1363b163843b0950cbb179d80753b2 (diff) | |
Small fix
| -rw-r--r-- | templates/home.html | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/templates/home.html b/templates/home.html index 61a3beb..ae0a933 100644 --- a/templates/home.html +++ b/templates/home.html @@ -19,15 +19,22 @@ } $(document).ready(function() { + $.get('/data', function(res) { + var data = res.data.split('\n===\n'); + $('#sequences-area').val(data[0]); + $('#composition-area').val(data[1]); + }) + $('#save-btn').click(function() { $.ajax({ type: 'POST', contentType: 'application/json', data: JSON.stringify({ - "data": $('#sequences-area').val() + '\n\n' + $('#composition-area').val() + "data": $('#sequences-area').val() + '\n===\n' + $('#composition-area').val() }), dataType: 'json', url: '/data', + success: function() { alert('Saved'); } }); }); }); |
