随笔分类 - 前端问题
包括jsp,freemarker,js,jquery,css,html
摘要:前台jsp或者ftl文件接收返回结果: <input type="hidden" name="selectedModelListStr" id="selectedModelListStr" value='${selectedModelListStr}'> 注意:value值用单引号,因为后台返回的结
阅读全文
摘要:js触发按钮点击事件 备注: 1.btnObj.click()是真正地用程序去点击按钮,触发了按钮的onclick()事件,按钮不隐藏的时候是可以调用的按钮隐藏之后就不行了,设定隐藏不要使用Visiable属性,使用style.display=none2.btnObj.onclick()只是简单地调
阅读全文
摘要:错误原因:该函数不是jquery的核心函数,所以需要外部引入ajaxfileupload.js文件,可能是没有引入,或者引入的js文件互相冲突 解决方法:每次进入一个函数之前打印该函数所有的js文件,console.log($.fn);最后发现引入版本互相冲突,只要使它们版本统一就行了. 没有引入j
阅读全文
摘要:设置div属性垂直对齐方式为:top <div style="vertical-align: top;"></div>
阅读全文
摘要:1.首先准备好要弹出的内容,一般用ajax向后台请求数据,组装成html: 主页:a.html,含有div: <div class="cms-window cms-window-other zadd-window salePrd-window"> </div> 副页:b.html 把副页展示在div
阅读全文
摘要:error: function(XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest.status); alert(XMLHttpRequest.readyState); alert(textStatus); }, 1.aja
阅读全文
摘要:客户端会缓存这些css或js文件,因此每次升级了js或css文件后,改变版本号,客户端浏览器就会重新下载新的js或css文件 ,刷性缓存的作用。大家可能有时候发现修改了样式或者js,刷新的时候不变,就是客户端缓存了css或者js文件,因此加上参数还是有好处的 <link rel="styleshee
阅读全文
摘要:1.<#if isChanged==1>id="skin_${skins_index*skins?size+skin_index+1}"<#else>id="skin_${skin_index+1}"</#if> 2.<a <#if advitismentFlag == 1>readonly="re
阅读全文
摘要:select id="initiatorId" name="initiatorId"> <#if initiatorId == '-1' || initiatorId == ''> <option value="-1" selected = "selected">全部</option> <#else
阅读全文
摘要:<#if startTime?datetime lt .now?datetime>:年月日时分秒比较 <#if startTime?date lt .now?date>:年月日比较 <#if startTime?time lt .now?time>:时分秒比较
阅读全文
摘要:http://www.w3school.com.cn/tiy/t.asp?f=jquery_traversing_each
阅读全文
摘要:1.varnish缓存和cdn缓存只支持get请求,post等其它请求不支持缓存 2.缓存的文件格式:.html,.htm,.json,.jsonp四种文件格式,其它的如.do是动态的请求,不需要缓存 3.varnish缓存是内存缓存,即服务器缓存,不支持集群,必须设置属性:s-maxage(单位:
阅读全文
摘要:delete from pub_channelpackage where channelcode = :channelcode and channeltype = :channeltype <#if packids?exists && packids??> and packid in ( <#lis
阅读全文
摘要:http://freemarker-online.kenshoo.com/
阅读全文
摘要:1.后台代码: ModelAndView mv = new ModelAndView("log/logList.ftl"); String info="abc"; mv.addObject("logInfo", info); return mv; 2.前台freemarker代码: ${logInf
阅读全文
摘要:实现在输入框按回车按钮进行查询的功能: 1.<input type="text" id="inputChannel" onkeydown="keyDown()" name="inputChannel" value ="" /> 2.js代码: <script type="text/javascrip
阅读全文
摘要:1.<#assign a='3333' /> 2.<input type="text" id="name" name="name" value=“${a}" />
阅读全文
摘要:在学习JS的面向对象过程中,一直对constructor与prototype感到很迷惑,看了一些博客与书籍,觉得自己弄明白了,现在记录如下: 我们都知道,在JS中有一个function的东西。一般人们叫它函数。比如下面的代码js代码:[javascript] view plaincopyprin...
阅读全文
摘要:1、首页检查web.xml中的配置,确保路径是正确的 <error-page> <error-code>404</error-code> <location>/error.jsp</location> </error-page> 2、然后再检查error.jsp文件内容是否有问题,比如只有<head
阅读全文