How To Append to URL in Javascript?

superaff1984

Senior Member
Premium Member
Joined
Jun 16, 2010
Messages
992
Reaction score
130
Hi, I am trying to append to the URL if this is true. I added params.append('declined', 'yes'); which does not execute. All my code works, but not adding declined=yes to the url if declined?

JavaScript:
                            if (data['Transaction']['OrderInfo']['Response'] === '3') {
                                $(".errorMessage").show();
                                $(".errorMessage").text("Your card was declined. Please check your card number, CVV, and expiration date again and then resubmit. If your card continues to decline, try another card or call the number on the back of your credit/debit card to authorize the transaction.");
                                params.append('declined', 'yes');

                           }
 
Using append is fine, but remember to push it to the browser URL with history.replaceState() for it to show.
 
Back
Top