我在ASP.NET中有一個網站,當人們訪問該網站時,會彈出一個小Cookie。我不想做的是複製這個,但對於經典ASP(不是我的錯誤)編寫的網站我知道代碼的作品,因爲它在當前網站上工作。我如何參考JavaScript以及它與頁面相關的地方?如果我的問題看起來很愚蠢,我對這一切都很陌生。預先感謝您的幫助。這是我使用的代碼:將JavaScript添加到經典ASP(新增功能)
DIV ID爲 「cookieConsentRequest」 RUNAT = 「服務器」 可見=「真
<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>-->
對不起它的國家
你是什麼意思的「參考Java」? – ulluoink
也許你應該展示你如何在.net中做這件事,以使事情更清晰。 – SearchAndResQ
你的意思是用來創建cookie的JavaScript?這與傳統的ASP和ASP.NET完全相同,只是將它放在'.asp'頁面本身的'
'部分。 –