diff --git a/static/js/newRoute.js b/static/js/newRoute.js index ef3706a..a8518f5 100644 --- a/static/js/newRoute.js +++ b/static/js/newRoute.js @@ -13,7 +13,7 @@ function createRoute(){ success: function(data){ console.log('data received') // location.href = '/profile' - document.querySelector(".profile").innerHTML = data.html + document.querySelector(".info_profile").innerHTML = data.html } }); } diff --git a/static/js/sendNewRoute.js b/static/js/sendNewRoute.js new file mode 100644 index 0000000..15be44e --- /dev/null +++ b/static/js/sendNewRoute.js @@ -0,0 +1,20 @@ +function sendRoute(){ + + $.ajax({ + headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, + url: '/ru/user_account/new_route_view/', + type: "POST", + // async: true, + cache: false, + processData: false, + contentType: false, + // enctype: 'json', + // data: {}, + success: function(data){ + console.log('data received') + // location.href = '/profile' + document.querySelector(".info_profile").innerHTML = data.html + } + }); +} + diff --git a/templates/blocks/profile/b_my_routes.html b/templates/blocks/profile/b_my_routes.html index 3a6cce8..5eadf2c 100644 --- a/templates/blocks/profile/b_my_routes.html +++ b/templates/blocks/profile/b_my_routes.html @@ -1,3 +1,3 @@