$ (Document) .ready (function () {.....}) which is not all code execution (initialization script is not executed)

The reason is that at the time of writing their own page, <script> .... </ script> in the wrong position, should be placed between the <head> </ head>, otherwise, it will not work

<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>订单添加</title>
<meta http-equiv="Content-Type" content="default"  name="decorator">
</head>
<script type="text/javascript">

$(document).ready(function(){
XXXXXX........里面的代码不会执行
});
</script>

<body> <ul class="nav nav-tabs">
<li><a href="${ctx}/sys/order/list">订单列表</a></li>
<li class="active"><a href="${ctx}/sys/order/form?orderId=${order.orderId}">订单<shiro:hasPermission name="sys:order:edit">${not empty order.orderId? ''Add':'Modify }
</shiro:hasPermission><shiro:lacksPermission name="sys:order:edit">查看</shiro:lacksPermission></a></li> </ul><br/>

。。。。。。。。。

Here is after the correction , so when entering this page,

$ (Document) .ready (function () {} content will work!

Here we do not prompt it so careless!

<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>订单添加</title>
<meta http-equiv="Content-Type" content="default"  name="decorator">
<Script type = "text / JavaScript"> 

 $ (Document) .ready (function () { 
       XXXXXX ........ not execute the code inside 
 }); 
 </ Script>
</head> 
<body>
<ul class="nav nav-tabs">
<li><a href="${ctx}/sys/order/list">订单列表</a></li>
<li class="active"><a href="${ctx}/sys/order/form?orderId=${order.orderId}">订单
<shiro:hasPermission name="sys:order:edit">${not empty order.orderId? '修改':'添加' }
</shiro:hasPermission><shiro:lacksPermission name="sys:order:edit">查看</shiro:lacksPermission></a></li> </ul>
<br/> 。。。。。。。。。

 

Guess you like

Origin www.cnblogs.com/isme-zjh/p/12664073.html