Мой код:
Часть 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>
Используйте 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>
Или добавьте submit после 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>
Ваш HTML недопустим. У вас не может быть input
внутри a
. Восстановление браузера из этой ошибки непостоянно. Похоже, что вход блокирует щелчок в IE.
У вас может быть ссылка или кнопка отправки там, но не оба.