比如这样一段代码。addHtml。
<div id="fullImage" class="modal fade bs-modal-sm" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-xs-12">
<img id="imgZoom" src=""class="img-responsive">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="selectToPic(1)">选择为大图</button>
<button type="button" class="btn btn-primary" onclick="selectToPic(0)">选择为小图</button>
</div>
</div>
</div>
</div>
<script src="${base!}/assets/js/productAdd.js"></script>
在此处引入自己写js,初次加载并不执行其中的alert,刷新后才能执行