diff options
| author | Freya Murphy <freya@freyacat.org> | 2024-04-03 11:35:13 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2024-04-03 11:35:13 -0400 |
| commit | ddfe92fee45a0f011da169391f60335a595b1a79 (patch) | |
| tree | 56fe9c0722d4a5bda43a3f6989a10e426dcff8ab /src/web/_views/modal/new_post.php | |
| parent | profile css + other css changes (diff) | |
| download | xssbook2-ddfe92fee45a0f011da169391f60335a595b1a79.tar.gz xssbook2-ddfe92fee45a0f011da169391f60335a595b1a79.tar.bz2 xssbook2-ddfe92fee45a0f011da169391f60335a595b1a79.zip | |
remove var
Diffstat (limited to 'src/web/_views/modal/new_post.php')
| -rw-r--r-- | src/web/_views/modal/new_post.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/web/_views/modal/new_post.php b/src/web/_views/modal/new_post.php index 66cb8c8..50b9b84 100644 --- a/src/web/_views/modal/new_post.php +++ b/src/web/_views/modal/new_post.php @@ -31,18 +31,18 @@ <script> $('#new-post-form').submit(function(e) { e.preventDefault(); - var content = $('#new-post-content').val(); - var me = $(this); + let content = $('#new-post-content').val(); + let me = $(this); - var getPost = function(data) { + const getPost = function(data) { if (data) { $('#post-container').prepend(data); } me.closest('.modal-container').remove(); } - var onPost = function(data) { - var id = data[0].id; + const onPost = function(data) { + let id = data[0].id; $.get({ url: '/_util/post/post?id=' + id, success: getPost @@ -52,7 +52,7 @@ $.ajax({ url: '/api/post', method: 'POST', - data: JSON.stringify({ content: content }), + data: JSON.stringify({ content }), success: onPost }); }); |