74 lines
1.9 KiB
JavaScript
74 lines
1.9 KiB
JavaScript
function createRoute(){
|
|
|
|
$.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
|
|
|
|
$(document).ready(function (e){
|
|
$('#id_weight').ionRangeSlider({
|
|
skin: "round",
|
|
type: "single",
|
|
min: 0,
|
|
max: 1000,
|
|
from: 100,
|
|
step: 1,
|
|
grid: true,
|
|
grid_num: 5,
|
|
});
|
|
|
|
});
|
|
|
|
//get dynamic value
|
|
// let fromCountry = document.getElementById('id_from_country');
|
|
// let toCounytry = document.getElementById('id_to_country')
|
|
//
|
|
// toCounytry.oninput = function (){
|
|
// console.log(toCounytry.value)
|
|
// }
|
|
// fromCountry.oninput = function (){
|
|
// console.log(fromCountry.value)
|
|
//
|
|
// };
|
|
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
function getRoute(){
|
|
$.ajax({
|
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
|
url: '/ru/routes/get_routes/',
|
|
type: "POST",
|
|
// async: true,
|
|
cache: false,
|
|
processData: false,
|
|
contentType: false,
|
|
// enctype: 'json',
|
|
// data: formData,
|
|
success: function(data){
|
|
console.log('data received')
|
|
// location.href = '/profile'
|
|
document.querySelector(".info_profile").innerHTML = data.html;
|
|
|
|
|
|
},
|
|
error: function (data, exception){
|
|
console.log(101)
|
|
|
|
}
|
|
});
|
|
}
|
|
|