Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#main").on("submit", "#searchForm", function (event) {
- event.preventDefault();
- $.ajax({
- url: "search.php",
- method: "POST",
- data: $(this).serialize(),
- dataType: 'json',
- success: function (response) {
- $("#queryArea").text(response.query);
- $("#numberDocuments").html(response.numberDocuments);
- $("#foundDocuments").html("");
- for (var key in response.found) {
- $("#foundDocuments").append(response.found[key] + '<br>');
- }
- },
- error: function (xhr, status, error) {
- console.log(error);
- console.log(xhr.responseText);
- alert(status);
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement