0

私のコード:

Jquery 部分:

$('#yesdownloadvideo').click(function(){
var expiryTime = parseInt($('#expirytime').val());    
$('#fade, #popuprel').fadeOut()
setCookie("emailpopup","cookie already set",expiryTime);    
});

HTML 部分:

<div class="yes-btn"><a id="yesdownloadvideo" href="<%=yesbuttonlink%>.html" target="_blank" style="text-decoration:none"><input type="submit" class="yesbtn-src" value="<%=yesText%>" /></a></div>

アプリケーションへの登録には一意であるため、電子メールまたはユーザー名を使用できます。

4

2 に答える 2

1

preventDefault()のように使用します。

$('#yesdownloadvideo').click(function(e){
   e.preventDefault();
   var expiryTime = parseInt($('#expirytime').val());    
   $('#fade, #popuprel').fadeOut()
   setCookie("emailpopup","cookie already set",expiryTime);    
});

また、次のようにhtmlを変更します

// Remove your submit button from link
<div class="yes-btn">
     <a id="yesdownloadvideo" href="<%=yesbuttonlink%>.html" target="_blank" 
         style="text-decoration:none"><%=yesText%></a>
</div>

または、後に送信を追加しますlink

<div class="yes-btn">
     <a id="yesdownloadvideo" href="<%=yesbuttonlink%>.html" target="_blank" 
         style="text-decoration:none"><%=yesText%></a>
     <input type="submit" class="yesbtn-src" value="<%=yesText%>" />
</div>
于 2013-09-23T06:53:33.353 に答える
0

HTML が無効です。inputの中にを含めることはできませんa。そのエラーからのブラウザの回復は一定ではありません。入力が IE でクリックをトラップしているようです。

そこにはリンクまたは送信ボタンのいずれかを配置できますが、両方を配置することはできません。

于 2013-09-23T06:56:35.870 に答える