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生成的动态页面都无 ...
随机推荐
- 初识gradle, idea+springboot Demo
写在前面; 使用maven管理写过几个springboot的系统, 此篇博客纯属记录整理学习的过程. 另外, 源码分享地址在最后. Java: 1.8.0_281 tomcat: 1.8 IDE: I ...
- this的指向问题及改变this指向
概念: this是运行环境下的一个系统变量, 由于this在不同的执行环境下有不同的值, 所以在使用this时,多加注意 (使用this之前,先打印) 1,在全局作用域下,this默认指向window ...
- node.js - 包、express
首先,要先在这里分享一下我的喜悦,从昨天开始其实一直都在喜悦当中的,我收到了我的第一份offer,这感觉不摆了,比第一桶金都还舒服,虽然我还没收到第一桶金哈哈,不过offer都得了应该也快了. 今天的 ...
- HCIE笔记-第一节-网络的基本概念
R&S= 路由交换 Datacom =数通 =数据通信 某个设备产生了数据之后,借助整体的网络到达目的地的过程. 网络历史 -- 数通为什么产生? 1946年:世界上第一台计算机诞生.军事 科 ...
- nodejs mysql pool 只能插入10条记录或者较少记录
BEGIN; 解决方案:从连接池获取到的Connection,执行完操作后,必须及时关闭! 即:connection.end(); 使用后发现console有打印出警告信息,大致意思为 end() 方 ...
- IoT平台如何实现业务配置中心
摘要:本文讲述业务配置中心(下文简述为配置中心)的关键技术和实现方式. 本文分享自华为云社区<手把手教你物联网平台如何实现业务配置中心>,作者: 华为云IoT专家团 . 上一篇<华为 ...
- 1.1 Qt Creater使用Python开发桌面软件的操作流程
Qt Creater及Python的下载与安装过程不再赘述,读者可自行在网上搜索相应的下载与安装方法. 首先我们打开Qt Creater,单击"Create Project"按钮或 ...
- [AcWing 32] 调整数组顺序使奇数位于偶数前面
点击查看代码 class Solution { public: void reOrderArray(vector<int> &array) { int i = 0, j = arr ...
- C++基础-2-引用
2. 引用 2.1 引用的基本语法 1 #include<iostream> 2 using namespace std; 3 4 5 int main() { 6 7 //引用的基本语法 ...
- Golang(go语言)开发环境配置
VSCode开发环境配置 目录 VSCode开发环境配置 先到VSCode官网去下载适合自己系统的VSCode安装软件 演示在WIndows下 安装使用 演示在Linux(Ubuntu/centos) ...