Who can tell the best way to transfer data to the database without reloading the page.
For example, my worst option:
<script type="text/javascript" language="javascript"> function senddata() { $.ajax({ type: 'POST', url: "senddata.php", data: { name: $('#pagename').val(), url:$('#pagelink').val()}, success: function(data){notification('Страница создана')} } )} </script>
In a separate file senddata.php
there is a deputy request for adding information to the database. In this embodiment, the message "Page created" crashes regardless of whether infa was added to the database or not, but it crashes depending on whether a request was sent to the senddata.php
file or not. Therefore, regardless of whether the record was in the database or not, it still gives the message "The page is created."