- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 ASP.NET 中有一个网站,当人们访问该网站时,会有一个小的 cookie 弹出警告。我不想做的是复制这个但是对于一个用经典 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>-->
对现在的状态感到抱歉。
最佳答案
JavaScript 是浏览器的一部分。您提供希望浏览器与 HTML 内联运行或作为 .js
运行的 JavaScript。 HTML 中引用的文件。
jQuery,引用 their website , 是“一个快速、小巧且功能丰富的 JavaScript 库。它使 HTML 文档遍历和操作、事件处理、动画和 Ajax 等事情变得更加简单,并通过一个易于使用的 API 跨多种浏览器工作” .
重要的是,jQuery 提供了 $
语法和 css
, slideDown
, fadeUp
等您的代码使用的函数。
因此您的代码必须引用 jQuery 库。这很容易通过在任何 jQuery 代码(使用 <head>
或 $
的 JavaScript)之前添加以下行(在 jQuery
中是可以但不一定是最佳实践)来轻松完成:
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
这添加了对其服务器上托管的最新(发布时)jQuery 代码的引用。您也可以download the library here并在本地引用。
关于javascript - 将 JavaScript 添加到经典 ASP(这是新的),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16936785/
本文实例总结了常用SQL语句优化技巧。分享给大家供大家参考,具体如下: 除了建立索引之外,保持良好的SQL语句编写习惯将会降低SQL性能问题发生。 ①通过变量的方式来设置参数 好:
写CSS的同学们往往会体会到,随着项目规模的增加,项目中的CSS代码也会越来越多,如果没有及时对CSS代码进行维护,CSS代码不断会越来越多。CSS代码交错复杂,像一张庞大的蜘蛛网分布在网站的各个位
所以我必须解决类的背包问题。到目前为止,我想出了以下内容。我的比较器是确定两个主题中哪一个是更好选择的函数(通过查看相应的(值,工作)元组)。 我决定迭代工作量小于 maxWork 的可能主题,并且为
前言:复杂类型说明 要了解指针,多多少少会出现一些比较复杂的类型,所以我先介绍一下如何完全理解一个复杂类型,要理解复杂类型其实很简单,一个类型里会出现很多运算符,他们也像普通的表达式一样,有优先级
代码如下: 复制代码代码如下: USE [tempdb] GO /****** Object: UserDefinedFunction [dbo].[fun
最近收到一个工作要求,让我完成一个每天一次的Linux服务器巡检工作(服务器的版本为红帽6.4),不可以使用监控软件来操作。在这里,把我的巡检过程和巡检脚本放送给大家做一参考。 首先,巡检内容
可以在 Classic ASP 中动态创建“空”对象并创建对象属性吗? 以这个 JavaScript 示例为例: var sample = new Object(); sample.prop = "O
我正在向旧的经典 asp 站点添加功能,但遇到了一个有趣的问题。页面上的以下行导致有用的错误“需要对象:''” strServerName = Request.ServerVariables("ser
我有一个经典的 ASP 应用程序,我正在处理日期截止。我的服务器位于中部时间,但我在东部时间。发生的情况是我的应用程序认为它早了一个小时,而我的截止时间晚了一个小时。我敢肯定,如果用户在太平洋时间,他
我是经典 ASP 的初学者。需要拆分一个由逗号分隔的许多电子邮件组成的字符串,并使用稍后生成的附加代码将结果插入(逐个电子邮件)到表格中。每条记录都应该有一个电子邮件地址。问题是我陷入了数组范围错误。
这个问题已经有答案了: one condition, multiple events (2 个回答) 已关闭 6 年前。 如何用更小的语句替换 1,2,3..。我尝试将 1 放入 10,但显示错误。
我是 ExtJS 的新手,所以我不知道是否可能。 Google 只回答如何为图表制作工具提示,所以... 我需要制作一个带有工具提示的网格,当用户将鼠标放在单元格上时将显示该工具提示。在该工具提示中,
我正在使用一个非常奇怪的 VB 版本...它不需要我告诉它什么是什么,它想自己弄清楚。 在 C# 中,我可以轻松地对数组进行硬编码...在 VB 中则不然。 我想在调用函数时创建一个硬编码数组...但
我的数据库访问代码如下: set recordset = Server.CReateObject("ADODB.Recordset") set cmd1 = Server.CreateObject(
我有 html 按钮和文本框的代码:文本框是我输入文本的地方,以便我可以在表格上进行一些更改。 'textbox " /> 'button Clear 我现在需要做的是单击“清除”按
我有一个表单,提交后会通过电子邮件发送。该表单使用 JavaScript 进行验证。经典 ASP 处理表单,即获取输入的数据、创建然后发送电子邮件。有报道称正在提交空白表格。仅发送标题和 Logo 。
加载页面 A.asp 默认情况下正在执行,从那里开始执行电子邮件的情况,如果是电子邮件,我们将调用页面 B。我想在控件被执行时执行相同的电子邮件情况从页面 B 转移到页面 A。请帮助我。 Page A
我正在使用经典 ASP 开发一个项目,例如,我想添加一些用户作为临时列表,当我提交表单时,这些数据将保存到数据库中。 我知道如何在 asp.net 中使用它,但不知道如何在经典 asp 中使用它。 例
我有一个带有简单 html 表的经典 ASP 页面,我想根据从数据库中提取的未知数量的记录循环表行,但是,当我使用 do/while 循环循环记录时,我收到一条错误消息,指出 Either BOF o
嘿,一直在寻找一段时间,但我似乎找不到任何有关如何在经典 asp 中处理日期的信息。 现在,我需要一种方法来计算今年过去的天数。我正在考虑一个简单的函数,它将获取当前日期,然后使用 (day = 1,
我是一名优秀的程序员,十分优秀!