HTML代码中<%%>、<%=%>、<%:%>各是什么意思?分别用来实现什么的?

运行、获取后台代码或值。
<%%>之间可以写服务器端代码,比如
<% 
for(var i=0;i<10;i++){
//执行循环体
}
%>
又如
<% 
for(var i=0;i<10;i++){
%>

 


//执行循环体(此时循环体为html语言
<%}
%>;
<%=%>获取后台的变量值,比如后台一个session["ab"]="ab";前台<%=session["ab"]%>就能取到值;
<%:%>同<%=%>。
posted @ 2016-07-17 14:04  JokerJason  阅读(9514)  评论(0编辑  收藏  举报

It's not who you are underneath, it's what you do that defines you

Brick walls are there for a reason :they let us prove how badly we want things