Commit 08bbf8fc authored by shoei.kanno's avatar shoei.kanno

list.js変更

parent 925004b9
...@@ -55,30 +55,6 @@ $(function(){ ...@@ -55,30 +55,6 @@ $(function(){
} ) ; } ) ;
//カートに追加
$('.cartBtn').on('click', function(event){
let data = {
shoesId: $(event.target.previousElementSibling.previousElementSibling.previousElementSibling).children('input').val(),
quantity: $(event.target.previousElementSibling.previousElementSibling).children('select').val()
};
console.log(data);
$.ajax({
type: "POST",
url: "/limited/inputCart",
contentType: 'application/json',
dataType: "json",
data: JSON.stringify(data)
}).done(function() {
$( "#modal-content,#modal-overlay" ).fadeOut( "slow" , function(){
//[#modal-overlay]を削除する
$('#modal-overlay').remove() ;
} ) ;
}).fail(function() {
alert("Failed.");
});
});
} ) ; } ) ;
...@@ -108,3 +84,28 @@ $(function(){ ...@@ -108,3 +84,28 @@ $(function(){
} ) ; } ) ;
//カートに追加
$('.cartBtn').on('click', function(event){
let data = {
shoesId: parseInt($(event.target.previousElementSibling.previousElementSibling.previousElementSibling).children('input').val()),
quantity: parseInt($(event.target.previousElementSibling.previousElementSibling).children('select').val())
};
console.log(data);
$.ajax({
type: "POST",
url: "/limited/inputCart",
contentType: 'application/json',
dataType: "json",
data: JSON.stringify(data)
}).done(function() {
$( "#modal-content,#modal-overlay" ).fadeOut( "slow" , function(){
//[#modal-overlay]を削除する
$('#modal-overlay').remove() ;
} ) ;
}).fail(function() {
alert("Failed.");
});
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment