js 生成的html class属性失效问题
- var html = '<fieldset class="struct-info" id="SlopeZY"><legend>变坡点(ZY)</legend>';
- html += '<input type="hidden" id="SlopeZYId" name="SlopeZYId"/>';
- if (me.Paras.IsUseCircle != undefined && me.Paras.IsUseCircle == 'True') {
- html += '<div class="row"><label for="SlopeZYStartCircle">开始环号:</label><input id="SlopeZYStartCircle" type="text" class="easyui-numberbox" precision="0" max="999999999" maxlength="16" min="-999999999" /></div>';
- html += '<div class="row"><label for="SlopeZYEndCircle">结束环号:</label><input id="SlopeZYEndCircle" type="text" class="easyui-numberbox" precision="0" max="999999999" maxlength="16" min="-999999999"/></div>';
- }
- html += '<div class="row"><label for="SlopeZYStartMileage">开始里程:</label>' + me.Paras.prefix +'<input id="SlopeZYStartMileage1" type="text" class="easyui-validatebox" data-options = "validType:'numberWithZero'" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/>+<input id="SlopeZYStartMileage2" type="text" class="easyui-validatebox" data-options = "validType:'double'" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/></div>';
- html += '<div class="row"><label for="SlopeZYEndMileage">结束里程:</label>' + me.Paras.prefix +'<input id="SlopeZYEndMileage1" type="text" class="easyui-validatebox" data-options = "validType:'numberWithZero'" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/>+<input id="SlopeZYEndMileage2" type="text" class="easyui-validatebox" data-options = "validType:'double'" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/></div>';
- html += '</fieldset>';
- html += '<fieldset class="struct-info" id="SlopeYZ"><legend>变坡点(YZ)</legend>';
- html += '<input type="hidden" id="SlopeYZId" name="SlopeYZId"/>';
- if (me.Paras.IsUseCircle != undefined && me.Paras.IsUseCircle == 'True') {
- html += '<div class="row"><label for="SlopeYZStartCircle">开始环号:</label><input id="SlopeYZStartCircle" type="text" class="easyui-numberbox" precision="0" max="999999999" maxlength="16" min="-999999999"/></div>';
- html += '<div class="row"><label for="SlopeYZEndCircle">结束环号:</label><input id="SlopeYZEndCircle" type="text" class="easyui-numberbox" precision="0" max="999999999" maxlength="16" min="-999999999"/></div>';
- }
- html += '<div class="row"><label for="SlopeYZStartMileage">开始里程:</label>' + me.Paras.prefix +' <input id="SlopeYZStartMileage1" type="text" class="easyui-validatebox" data-options = "validType:'numberWithZero'" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/>+<input id="SlopeYZStartMileage2" type="text" class="easyui-validatebox" data-options = "validType:'double'" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/></div>';
- html += '<div class="row"><label for="SlopeYZEndMileage">结束里程:</label>' + me.Paras.prefix +' <input id="SlopeYZEndMileage1" type="text" class="easyui-validatebox" data-options = "validType:'numberWithZero'" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/>+<input id="SlopeYZEndMileage2" type="text" class="easyui-validatebox" data-options = "validType:'double'" precision="8" max="999999999" maxlength="16" min="-999999999" style="width:68px;"/></div>';
- html += '</fieldset>';
- $('.content').append(html);
问题描述:通过js添加的输入框,带有easyui-validatebox 验证,但是到前台后,发现验证失效了。
解决办法:在append方法调用后 添加 $.parser.parse($('.content')); 手动激活有效性。
js 生成的html class属性失效问题的更多相关文章
- javascript私有属性失效及解决方案
1.js创建私有属性的方法 在 javascript 中所有对象的成员是公有的 构造函数也是如此: function Gadget ( ) { this.name = ' jack '; this.p ...
- js生成有缩进的表格
项目中用到用了两天时间想到的,记录下来,如有更好的方法,留言给我,谢谢! js做如下表格: json [{"id":302,"serviceId":15,&qu ...
- 前端学习-使用JS库Leaflet.js生成世界地图并获取标注地址经纬度。
介绍:Leaflet是一个开源的JavaScript库,对移动端友好且对地图有很好的交互性. 大小仅仅只有 33 KB, 同时具有大多数地图所需要的特点. Leaflet设计的非常简单易懂, 同时具有 ...
- attr设置checked,disabled等属性失效的问题,jquery的attr和prop的区别
最近做项目遇到一个问题,radio设置了默认checked值,attr("checked",true)切换checked值失效 最后发现是jquery1.6版本之后,attr和pr ...
- JS生成指定范围内的随机数(支持随机小数)
直接需要函数的话,直接到文章的最后面找. ============================================================= 转载:https://www.cn ...
- js生成二维码以及点击下载二维码
js生成二维码 jquery.qrcode.js可以快速使用页面生成二维码.但改项目有两个小问题:1.不支持中文:2.不支持二维码中间生成图片. 支持中文的jquery-qrcode jquery.q ...
- Java与JS生成二维码
1.二维码概念 二维码/二维条码是用某种特定的集合图形按一定规律在平面上(二维方向上)分布的黑白相间的图形记录数据符号信息的图片. 黑线是二进制的1,空白的地方是二进制的0,通过1.0这种数据组合用于 ...
- SpringBoot @EnableAutoConfiguration exclude属性失效
本文链接:https://blog.csdn.net/yuan_ren_sheng/article/details/81516779 在学习SpringBoot的时候,入了不少的坑.今天学习@Spri ...
- 利用scrapy-splash爬取JS生成的动态页面
目前,为了加速页面的加载速度,页面的很多部分都是用JS生成的,而对于用scrapy爬虫来说就是一个很大的问题,因为scrapy没有JS engine,所以爬取的都是静态页面,对于JS生成的动态页面都无 ...
随机推荐
- 初识tomcat和servlet
web相关概念回顾 软件架构 C/S:客户端/服务器端 B/S:浏览器/服务器端 资源分类 静态资源:所有用户访问后,得到的结果都是一样的,称为静态资源.静态资源可以直接被浏览器解析 如: html, ...
- 记一次MySql重置root密码无效
说起这个事情吧也相对来说比较尴尬,对于一个技术来说忘记密码然后找回密码都是相当简单的一个事情,但是在生产环境中没有保存记录只能是自己的失职,尴尬就尴尬在明明重置成功了却没有生效,弄得好几个工程师在哪里 ...
- VulnHub-Earth 打靶记录
目录 VulnHub-Earth 打靶记录 知识点 目标探测 信息收集 Shell反弹&信息二次收集 提权 权限维持 VulnHub-Earth 打靶记录 搭建靶场的时候一定要使用NATser ...
- 终极套娃 2.0|云原生 PaaS 平台的可观测性实践分享
某个周一上午,小涛像往常一样泡上一杯热咖啡 ️,准备打开项目协同开始新一天的工作,突然隔壁的小文喊道:"快看,用户支持群里炸锅了 -" 用户 A:"Git 服务有点问题, ...
- [报告] Microsoft :Application of deep learning methods in speech enhancement
Application of deep learning methods in speech enhancement 语音增强中的深度学习应用 按: 本文是DNS,AEC,PLC等国际级语音竞赛的主办 ...
- FreeRTOS --(1)链表
转载自 https://blog.csdn.net/zhoutaopower/article/details/106550648 Based On FreeRTOS Kernel V10.3.1 1. ...
- 【java】错误: 找不到或无法加载主类 Test.class
在配置java环境完成时,在cmd中运行 java -version 可以运行,但是当运行 helloworld 文件时,报错. 两种情况 解决: 1.运行 java helloworld 而不是 ...
- 推荐 | Linux 思维导图整理(建议收藏)
一个执着于技术的公众号 作者:小柑 来源:https://www.jianshu.com/p/59f759207862 今天整理了一下收集的 Linux 思维导图.上传的均为高清原图,双击即可查看,也 ...
- pyhon对excel的xls与xlsx的读取,写入
import shutilimport osfrom openpyxl import load_workbookfrom xlutils.copy import copyimport win32com ...
- mysql二进制日志和mysql备份工具介绍以及日志恢复
mysql备份: 三种备份方式 冷备:数据库停机,在进行备份 热备:lock table锁表,read 数据库只可以读不能写,在备份 温备:备份时数据库正常运行 备份类型:完整备份:全部备份,部分 ...