function compare(str1, str2) {
return clearString(str1) === clearString(str2);
}
function clearString(str) {
return str.toLowerCase().replace(/\s/g, '');
}
compare(name, name2) // => true
name.split(' ').join('').toLowerCase() === name2.split(' ').join('').toLowerCase()
new Vue({
el: "#my_submit",
methods: {
send: function(){
axios.post('/my_page', json)
.then(function (response) {
this.somevar = response //<----------------------------------
console.log(response.data.foo);
})
.catch(function (error) {
console.log(error);
});
...
{{somevar}}
var test = document.getElementById("test").value