-3
我有下面的代碼,我試圖使按鈕打開一個新的選項卡與生成的鏈接,幫助?Javascript按鈕來打開新窗口點擊
$(document).ready(function() {
$("#form").on('submit', function(e) {
e.preventDefault();
window.location.replace("https://www.payjunction.com/trinity/quickshop/add_to_cart_snap.action?store=paymentbutton&description=INVOICE NO. " + $("#invoice_number").val() + "&need_to_tax=no&need_to_ship=no&price=" + $("#payment_amount").val());
});
});
<!DOCTYPE html>
<html dir="ltr">
<body> Enter your <b>Invoice Number</b> and <b>Payment Amount</b> below:
<form id="form"> <input type="text" name="invoice_no" placeholder="Invoice Number" value="" id="invoice_number" required>
<input type="text" name="payment_amount" placeholder="Payment Amount" value="" id="payment_amount" required>
<button type="submit" id="button">Pay with Credit Card</button>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
</form>
你爲什麼不乾脆把'目標=「_空白」'的''
問題是? – ochi
@ochi:*«我試圖讓按鈕在新選項卡中打開»* –