On the event highlighted in bold below, when I swipe right I want the product to
ID: 3724962 • Letter: O
Question
On the event highlighted in bold below, when I swipe right I want the product to be added to a checkout, but I am unsure of the correct syntax to do this.
var cards =[
new Tindercardsjs.card(2, 'Adidas', 'shoes, $90', 'runners.jpg'),
new Tindercardsjs.card(1, 'Converse', 'shoes, $40.', 'converse.jpg'),
new Tindercardsjs.card(0, 'Nike', 'shoes, $55', 'nike.jpg'),
];
Tindercardsjs.render(cards, $('#main'), function (event) {
if(event.direction === 'right' && event.cardid==0){
window.location.href =' <form target="" action="" method="post" value="">'; //how can i fix this line?
}
else if(event.direction === 'right' && event.cardid==1){
window.location.href = 'https://www.converse.com';
}
else{
""; }
Explanation / Answer
if(event.direction === 'right' && event.cardid==0){
window.location.href =' <form target="" action="" method="post" value="">'; //how can i fix this line?
Answer:- here if you want to redirect to another page or link then you have to pass here full path of the page or website like :
window.location.href ='www.google.com ';
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.