2013-01-17 206 views
0

我正在嘗試在我的網頁上添加Checkout BuyNow按鈕。 該按鈕按預期方式顯示,但按下按鈕時不會發生任何反應。下面是代碼:BuyNow按鈕不起作用

<span> 
<form 
action=https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/XXXXXXXXXXX id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm" target="_top"> 
<input name="item_name_1" type="hidden" value=""/> 
<input name="item_description_1" type="hidden" value=""/> 
<input name="item_quantity_1" type="hidden" value="1"/> 
<input name="item_price_1" type="hidden" value="24.9"/> 
<input name="item_currency_1" type="hidden" value="USD"/> 
<input name="item_weight_1" type="hidden" value="3.0"/> 
<input name="item_weight_unit_1" type="hidden" value="LB"/> 
<input name="_charset_" type="hidden" value="utf-8"/> 
<input alt="" 
src="https://checkout.google.com/buttons/buy.gif?merchant_id=XXXXXXXXXXX&amp;w=117&amp;h=48&amp;style=white&amp;variant=text&amp;loc=en_US" 
type="image"/> 
</form> 
</span> 

回答

0

嘗試舉辦超過<span>元素的<div>元素rahter裏面的按鈕<form>

表單是一個塊級元素。 span是一個內聯元素。內嵌的元素不能有塊元素。根據瀏覽器的不同,單擊按鈕時可能會出現不同的行爲。