ASP中双引号单引号和&连接符使用技巧
2009-06-18 10:11
148 查看
<script type="text/javascript"><!--
google_ad_client = "pub-4490194096475053";
/* 内容页,300x250,第一屏 */
google_ad_slot = "3685991503";
google_ad_width = 300;
google_ad_height = 250;
// --></script>
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
ASP中双引号单引号和&连接符使用技巧
一、ASP中处在双引号中的可以是任意的字符、字符串,HTML代码
1.<%response.write ("I am here")%><%response.write ("cnbruce here")%>
2.<%response.write ("<b>I am here</b>")%>
3.<双引号为就近匹配,如有单引号AND连接符包含于和连接将<延后引号>>response.write("I am here")
因为color的前引号和write的前引号形成匹配,内容为I am here。最终结果是:中间的 #0000ff 被孤单了
<%response.write("<font color=" & "#0000ff" & ">I am here</font>")%>
<%
response.write("cnbruce")
%>
二、单引号:如学习语文课一样,继续放在双引号中的引号可以采用单引号
response.write("I am here")
三、ASP中&号的主要作用是用来连接的,包括:字符串-字符串、字符串-变量、变量-变量等混合连接
<%
mycolor="#0000ff"
response.write ("<font color= "&mycolor&" >" & "cnbruce" & "</font>")
%>
<%
mycolor="#0000ff"
response.write ("" & "cnbruce" & "")
%>
单引号(双引号中不用)中<变量保持>关键写法:<将ASP中的变量继续添加左右的"&包括>,就可以放到response.write的引号中了,效果即为:response.write(" "&mycolor&" ")
注:asp<输出response主要处理变量,字符串,html代码>(对单一标记可做为字符串来处理)
response.write"a"
response.write("a")
显示一样都是输出的<字符串a,>
而response.write(a)和<%=a%><%=a%>输出的是变量a 的值
google_ad_client = "pub-4490194096475053";
/* 内容页,300x250,第一屏 */
google_ad_slot = "3685991503";
google_ad_width = 300;
google_ad_height = 250;
// --></script>
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
ASP中双引号单引号和&连接符使用技巧
一、ASP中处在双引号中的可以是任意的字符、字符串,HTML代码
1.<%response.write ("I am here")%><%response.write ("cnbruce here")%>
2.<%response.write ("<b>I am here</b>")%>
3.<双引号为就近匹配,如有单引号AND连接符包含于和连接将<延后引号>>response.write("I am here")
因为color的前引号和write的前引号形成匹配,内容为I am here。最终结果是:中间的 #0000ff 被孤单了
<%response.write("<font color=" & "#0000ff" & ">I am here</font>")%>
<%
response.write("cnbruce")
%>
二、单引号:如学习语文课一样,继续放在双引号中的引号可以采用单引号
response.write("I am here")
三、ASP中&号的主要作用是用来连接的,包括:字符串-字符串、字符串-变量、变量-变量等混合连接
<%
mycolor="#0000ff"
response.write ("<font color= "&mycolor&" >" & "cnbruce" & "</font>")
%>
<%
mycolor="#0000ff"
response.write ("" & "cnbruce" & "")
%>
单引号(双引号中不用)中<变量保持>关键写法:<将ASP中的变量继续添加左右的"&包括>,就可以放到response.write的引号中了,效果即为:response.write(" "&mycolor&" ")
注:asp<输出response主要处理变量,字符串,html代码>(对单一标记可做为字符串来处理)
response.write"a"
response.write("a")
显示一样都是输出的<字符串a,>
而response.write(a)和<%=a%><%=a%>输出的是变量a 的值
相关文章推荐
- ASP中双引号单引号和&连接符使用技巧
- ASP中双引号单引号和&连接符使用技巧
- js “+” 连接字符串&数字相加 数字相加出现多位小数 函数调用单引号双引号嵌套和转义字符的使用
- "[转]以下一些使用ASP.NET和VS.NET2003的经验和技巧," 一文的评论:
- asp.net中关于&,双引号和单引号的用法
- ASP和SQL语句中的双引号、单引号和&
- ASP中双引号"";单引号'';连接字符&号的用法
- php echo输出html标签时但引号双引号交替使用技巧
- C#如何使用转义字符来正确的表示双引号、单引号等字符串 asp.net
- PHP中双引号""与单引号''使用区别
- 关于SQL语句中的双引号、单引号和&-------asp.net
- ASP.NET应用技巧:非托管COM组件的使用
- Windows远程桌面连接的使用技巧
- 【转】CEdit &amp; CRichEdit 使用技巧
- 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')
- ASP.Net MVC连接MySQL和Code First的使用
- 在ASP.NET中使用WINDOWS验证方式连接SQL SERVER数据库
- shell中" "(双引号)与 ' '(单引号)的区别
- js、html中的单引号、双引号及其转义使用