我在 ASP.NET 中有一个网站,当人们访问该网站时,它会弹出一个小 cookie 警告。我不应该做的是复制这个,但是对于一个用 Classic ASP 编写的站点(不是我的错),我知道代码可以工作,因为它可以在当前站点上工作。我如何引用 JavaScript 以及它与页面相关的位置?如果我的问题看起来真的很愚蠢,我对这一切都很抱歉。提前感谢您的帮助。这是我正在使用的代码:
div id="cookieConsentRequest" runat="server" visible="true
<p><span class="queryIcon"></span>some text here <a href="#" class="acceptCookiesAnchor acceptCookieSmall acceptCookie" runat="server">I accept</a>
<a href="Javascript:;" class="infoCookie" title="Tell me more about these cookies">Click here for more info</a>
<a href="Javascript:;" id="alertBannerHide" class="hideButton" title="Hide this">Hide</a>
</p>
</div>
<!--[if IE 6]>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$('.alertBanner').css("top", ($(window).height() - 29));
});
</script>
<![endif]-->
<script type="text/javascript">
$(document).ready(function () {
$('.alertBanner').css("left", (($(window).width() / 2) - 360));
$('.alertBanner').delay(1000).slideDown('slow');
$('#alertBannerHide, a.denyCookie').click(function () {
$('.alertBanner').slideUp('slow');
$('.cookieInfoWindow').fadeOut('fast');
});
$('.cookieInfoWindow').css("left", (($(window).width() / 2) - 320));
$('a.acceptCookie, .infoCookie').click(function () {
$('.cookieInfoWindow').fadeIn('fast');
});
$('#cookieInfoWindowHide, .cookieInfoWindow a.denyCookie').click(function () {
$('.cookieInfoWindow').fadeOut('fast');
$('.alertBanner').slideUp('slow');
});
});
</script>
<div class="cookieInfoWindow">
<h3><a href="Javascript:;" id="cookieInfoWindowHide" class="hideButton" title="Hide this">Hide</a>Cookies used on this web site</h3><br />
<p>some text here</p><br />
<p>some text here <a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55539" class="externalLinkWhite"
title="Read more about Google Analytics (external link)">Google Analytics</a> some text here.</p><br />
<p>some text herep><br />
<p>For more information on how cookies are used please visit the following websites:</p>
<ul>
<a href="http://www.microsoft.com/info/cookies.mspx" class="externalLinkWhite" title="Information about cookies on Microsoft.com (external link)">Microsoft Cookie Information</a><br /><br />
<a href="http://www.allaboutcookies.org/" class="externalLinkWhite" title="All about computer cookies (external link)">All About Cookies</a>
</ul>
<p>
<a id="acceptCookiesAnchor" href="#" class="acceptCookie" runat="server">Yes, I accept the use of cookies as outlined above</a>
</p>
</div>
</div>-->
对不起它的状态。