随笔分类 -  javascript

摘要:场景:在 jsp 页面中获取到 input 框的中文值,作为参数通过 ajax 传递到后端会出现乱码现象 解决方法: 在 jsp 页面中使用 JavaScript 的 encodeURI() 函数对中文参数进行编码: var chinaName = jQuery("#chinaName ").val 阅读全文
posted @ 2021-04-07 18:20 南山下的采药人 阅读(336) 评论(0) 推荐(0)
摘要:; cpic.util = {}; /**** * 校验 * @param elementsId * @param validateRequired required是否校验(暂存时) * @param context * @returns {Boolean} */ cpic.util.doVali 阅读全文
posted @ 2021-03-04 16:13 南山下的采药人 阅读(133) 评论(0) 推荐(0)
摘要:+function tab($){ //警告框 $.fn.alert = function(e){ var $this = $(this); $this.find('.close').click(function(){ $this.fadeOut(250); }); }; //一、二级菜单 $.fn 阅读全文
posted @ 2021-03-04 16:09 南山下的采药人 阅读(171) 评论(0) 推荐(0)
摘要:/**** * 给指定的button创建上传操作 */ ;cpic.upload = function(attachButtonId, isRead) { var code = isRead?"ECM0002":"ECM0001"; var formId = "_" + attachButtonId 阅读全文
posted @ 2021-03-04 16:06 南山下的采药人 阅读(202) 评论(0) 推荐(0)
摘要:/** * JSP多个div找到父级节点 */ cpic.addMainHtml = function(div){ $("#"+div,window.top.document.body).remove(); var userModal =$("#"+div).parent().html(); $(w 阅读全文
posted @ 2021-03-04 16:03 南山下的采药人 阅读(181) 评论(0) 推荐(0)
摘要:/**** * @param idMap {insured:['insuredName','insuredAge'],applicant:['applicantName','applicantSex']} * @return * { * insured:{ * insuredName:"nick", 阅读全文
posted @ 2021-03-04 15:54 南山下的采药人 阅读(87) 评论(0) 推荐(0)
摘要:/** * 提示框 * @param content 必须,提示内容 * @param title 默认为“提示”,可不传 * @param onClose 关闭提示框后执行的函数function,可不传 */ cpic.alert=function(content, title, onClose) 阅读全文
posted @ 2021-03-04 15:51 南山下的采药人 阅读(169) 评论(0) 推荐(0)
摘要:/** * 初始化省市联动 * @param idMap [{p:'provinceSelect',c:'citySelect'}] **/ cpic.initArea = function(idMap){ for(var i=0;i<idMap.length;i++) { $("#" + idMa 阅读全文
posted @ 2021-03-04 15:48 南山下的采药人 阅读(152) 评论(0) 推荐(0)
摘要:/*** * 生成页码,小于2时没有页码 * @param page 当前页(Number) * @param totalPage 总页码(Number) * @param pagerSelector 生成的页码所放置的id(String) * @param callbackFunctionName 阅读全文
posted @ 2021-03-04 15:38 南山下的采药人 阅读(143) 评论(0) 推荐(0)
摘要:1 //设置日期控件 2 3 $("#startdate,#enddate").datepicker({ 4 changeMonth : true, 5 changeYear : true, 6 dateFormat : 'yy-mm-dd', 7 yearRange : "-100:+50", 8 阅读全文
posted @ 2021-03-04 15:28 南山下的采药人 阅读(507) 评论(0) 推荐(0)