web前端|html教程
iframe页面修改parent页面的隐藏input部件value值,不能触发change事件。
web前端-html教程
实现一个根据iframe页面返回充值卡类型不同,安排不同的input部件。
近乎专业版源码,ubuntu添加启动命令,自动做爬虫软件,php是什么类型的计算机语言,seo网上爬虫lzw
点击选择弹出一个iframe,点击充值卡数据行,返回1、充值卡类型。2、充值卡id(用的UUID)。3、充值卡号(字符串)。
javashop源码,ubuntu内核版本对应,tomcat7 项目404,equests爬虫库,php显示调试信息,江津区中小企业seo推广哪家好lzw
遇到的问题是当iframe选择充值卡时,无法获取parent页面input部件value值的change事件。
券 源码,ubuntu网卡设备名,服务器上tomcat项目吗,网络爬虫占满端口,网站首页可以命名为php吗,西青seo外包lzw
parent页js
$("#id_card_type").change(function(){//事件无法捕获});
parent页form
选择
iframe页js
$(this).children().click(function(){var cid=$(this).parent( r).attr(item_id);var cn=$(this).parent( r).children( d).eq(0).html();var ct=$(this).parent( r).attr(item_type);$(#id_card_id, window.parent.document).val(cid);$(#id_cardno, window.parent.document).val(cn);$(#id_card_type, window.parent.document).val(ct);});
解决如下:
iframe页js
$(this).children().click(function(){ var cid=$(this).parent( r).attr(item_id); var cn=$(this).parent( r).children( d).eq(0).html(); var ct=$(this).parent( r).attr(item_type); $(#id_card_id, window.parent.document).val(cid); $(#id_cardno, window.parent.document).val(cn); $(#id_card_type, window.parent.document).val(ct); //$(#id_card_type, window.parent.document).trigger(change); //无效 window.parent.$(#id_card_type).trigger(change); //有效});
如果觉得《iframe页面修改parent页面的隐藏input部件value值 不能触发change事件。【HTML】》对你有帮助,请点赞、收藏,并留下你的观点哦!