<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
1. 加载jsp的两种方式:
<jsp:include page="../common/common.jsp"/>
<jsp:include page="common/top.jsp"/>
2. jsp获取jsp路径的方式:
<%
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+ request.getServletPath();
%>
<head>
<base href=" <%=basePath%>"> >
</head>
3. 对radio的选中:$("input[name='is_prepay'][value='0']").prop("checked",true);
3.1. 获取radio的值:
$('input:radio:checked').val();
$("input[type='radio']:checked").val();
$("input[name='rd']:checked").val();
4. 对checkedBox的选中:$("input[name='branchOfficeIds'][value=" + branchOfficeIds[i].value + "]").prop("checked",true);
4.1. 获取选中的checkbox的值:checkbox的一个组:$("input:checkbox[name='branchOfficeIds']:checked")
5. 获取属性的值:$("#is_point_ded").prop("checked");
6.
<c:choose>
<c:when test="${empty userBranchOfficeId}">
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${empty param.username}">
Nnknown user.
</c:when>
<c:when test="${param.username=='Tom'}">
${param.username} is manager.
</c:when>
<c:otherwise>
${param.username} is employee.
</c:otherwise>
</c:choose>
7.
<c:forEach items="${hotelSchemeList }" var="hotelScheme">
</c:forEach>
8.
<c:if test="${hotelSchemeList== null || fn:length(hotelSchemeList) == 0}">
</c:if>
9.
<li><a href="javascript:;">人民广场</a></li>
<input type="hidden" name="wxUserId" id="wxUserId" value="${userOpenId}"/>
<fmt:formatDate value="${XXX.date}" pattern="yyyy-MM-dd"/>
${fn:length(shoppingCart.products)}
10.
$.ajax({
url:"${pageContext.request.contextPath}/admin/hotelScheme/toUpdateHotelScheme",
data:{"id":id},
type: "POST",
dataType: "JSON",
async: false,
contentType: "application/x-www-form-urlencoded;charset=utf-8",
success:function(data){
if(data != null){
};
},
});
11. jquery this: $(this).attr('title', 'OK');
12. el对象获取属性:${wgiftEnterpriseInfo.enterprise_details }
13. 获取某元素的某属性的值:$("li[class='class-present']").text()
14. jquery,for循环:
$("i[style='display: block;']").each(function(){
class_ids.push($(this).attr("data-id"));
});
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
1. 加载jsp的两种方式:
<jsp:include page="../common/common.jsp"/>
<jsp:include page="common/top.jsp"/>
2. jsp获取jsp路径的方式:
<%
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+ request.getServletPath();
%>
<head>
<base href=" <%=basePath%>"> >
</head>
3. 对radio的选中:$("input[name='is_prepay'][value='0']").prop("checked",true);
3.1. 获取radio的值:
$('input:radio:checked').val();
$("input[type='radio']:checked").val();
$("input[name='rd']:checked").val();
4. 对checkedBox的选中:$("input[name='branchOfficeIds'][value=" + branchOfficeIds[i].value + "]").prop("checked",true);
4.1. 获取选中的checkbox的值:checkbox的一个组:$("input:checkbox[name='branchOfficeIds']:checked")
5. 获取属性的值:$("#is_point_ded").prop("checked");
6.
<c:choose>
<c:when test="${empty userBranchOfficeId}">
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${empty param.username}">
Nnknown user.
</c:when>
<c:when test="${param.username=='Tom'}">
${param.username} is manager.
</c:when>
<c:otherwise>
${param.username} is employee.
</c:otherwise>
</c:choose>
7.
<c:forEach items="${hotelSchemeList }" var="hotelScheme">
</c:forEach>
8.
<c:if test="${hotelSchemeList== null || fn:length(hotelSchemeList) == 0}">
</c:if>
9.
<li><a href="javascript:;">人民广场</a></li>
<input type="hidden" name="wxUserId" id="wxUserId" value="${userOpenId}"/>
<fmt:formatDate value="${XXX.date}" pattern="yyyy-MM-dd"/>
${fn:length(shoppingCart.products)}
10.
$.ajax({
url:"${pageContext.request.contextPath}/admin/hotelScheme/toUpdateHotelScheme",
data:{"id":id},
type: "POST",
dataType: "JSON",
async: false,
contentType: "application/x-www-form-urlencoded;charset=utf-8",
success:function(data){
if(data != null){
};
},
});
11. jquery this: $(this).attr('title', 'OK');
12. el对象获取属性:${wgiftEnterpriseInfo.enterprise_details }
13. 获取某元素的某属性的值:$("li[class='class-present']").text()
14. jquery,for循环:
$("i[style='display: block;']").each(function(){
class_ids.push($(this).attr("data-id"));
});