Javascript中<%=%>是做什么的

这是客户端代码与服务器代码混合使用。
<%= %>中,在<% %> 之间的是服务器端代码,外面的是客户端代码。
若前面有个=,则是直接引用服务器代码中的值。
如:
<%string a = "a string";%>
那么下面这样引用
<input type="text" value="<%=a %>" />
在客户端就能看到
<input type="text" value="a string" />

posted @ 2016-01-21 17:34  ice_flower_ly  阅读(9680)  评论(1编辑  收藏  举报