[轉]js操作iframe的一些知识

JavaScript嵌入与操作IFrame技术指南 IFrame(内联框架)是一种在网页内部嵌入另一个HTML页面的技术,允许页面之间互相独立。它被广泛应用于嵌入第三方内容,如视频、广告、地图等,同时保持页面其他部分的交互性。IFrame同样也是实现前后端分离架构的一个重要工具。跨域资源共享(CORS)是一个W3C标准,允许一个域(源)的网页资源被另一个域(源)的脚本请求。为了使用CORS,服务器必须在响应头中包含等CORS相关的头信息,以表明哪些域名可以访问资源。 阅读详情

轉自http://www.blogjava.net/amigoxie/archive/2008/01/31/178718.html

1. 打印iframe
     eg. frameName.document.execCommand('print');
2. 获取iframe
    eg. var ifr_window = window.frames["frameName"];
3. 获取iframe中的元素
   eg1. 将iframe中id为elementId 的元素置为不显示:
         var ifr_window = window.frames["frameName"];
         ifr_window.elementId.style.display = 'none';
  eg2. 获取iframe中id为listTable的表格
        var oTable =   window.frames["myFrame"].document.all.listTable;
4. 隐藏或显示表格的某列
    js函数:
    function setHiddenOrShowCol(oTable, iCol, type) {
        for (i = 0; i < oTable.rows.length ; i++)  {
            oTable.rows[i].cells[iCol].style.display = type;
        }
    }
    调用举例,将id为listTable的表格元素的第4列置为不显示:
    var oTable =   window.frames["myFrame"].document.all.listTable;
    setHiddenOrShowCol(oTable, 3, 'none');
    调用举例2,将id为listTable的表格元素的第4列置为显示:
    var oTable =   document.frames.myFrame.document.all.listTable;
    setHiddenOrShowCol(oTable, 3, 'block');

深度学习PyTorch代码模板——模型训练框架、数据处理、绘图… 个人用深度学习代码模板:模型训练框架、数据处理、绘图等。待补充。 阅读详情

相关推荐

Windows/Mac/Linux三系统保姆级教程:用llama.cpp将safetensors模型转gguf格式(附常见错误解决)

本文提供Windows、Mac和Linux系统下使用llama.cpp将safetensors模型转换为gguf格式的详细教程,涵盖环境配置、转换原理及常见错误解决方案。通过跨平台兼容性处理,帮助开发者高效完成模型格式转换,优化边缘计算性能。

weixin_29227425的博客 270

document对象execCommand的命令参数介绍

document对象execCommand的命令参数介绍 2009-01-12 14:18 document.execCommand()方法处理Html数据时常用语法格式如下: 复制内容到剪贴板 代码: document.execCommand(sCommand[,交互方式, 动态参数])   其中:sCommand为指令参数(如下例中的"2D-Position"),交互方式参数如果...

hljqfl的专栏 1439

深入解析五大ADC芯片架构及其应用场景

本文深入解析了五大ADC芯片架构及其应用场景,包括逐次逼近型ADC、Σ-Δ型ADC、流水线型ADC、闪存型ADC和积分型ADC。通过详细的架构分析和实际应用案例,帮助工程师理解不同ADC芯片的特点和适用场景,提升电路设计效率。

weixin_28702105的博客 354

Js:关于document.execCommand()函数可用参数大解析

2D-Position 允许通过拖曳移动绝对定位的对象。 AbsolutePosition 设定元素的 position 属性为“absolute”(绝对)。 BackColor 设置或获取当前选中区的背景颜色。 BlockDirLTR 目前尚未支持。 BlockDirRTL 目前尚未支持。 Bold 切换当前选中区的粗体显示与否。 BrowseMode 目前尚未支持。 Copy 将当

nittystone的专栏 2332

量化 insider 爆料! 散户打板必亏?(打板必看!量化资金如何“隔日砸盘”收割散户)

量化开发 insider 爆料💥 散户追的涨停板📉,可能是机构故意做的陷阱!本文从技术视角拆解“涨停陷阱”,帮你看清市场真实逻辑🧠。

XiaoqiangClub的博客 450

Android影像系统架构专家面试指南

传音控股招聘影像系统架构专家,要求8年以上开发经验,5年架构设计经验,精通Android Camera开发及性能优化。该职位需负责手机影像软件架构设计、技术选型及跨平台适配,重点解决"快稳省"体验优化。面试评估聚焦三大维度:技术方面考察HAL层架构设计、多帧合成优化等能力;系统开发关注低光降噪等场景的算力平衡;团队管理侧重跨部门协作与项目交付。候选人需展现对CamX-CHI等架构的深入理解,具备量化分析性能指标的能力,并能主导旗舰机影像项目全周期落地。

郑伟强dev的专栏 941

实现打印的几种方式

1.        调用frmae 执行print命令          idFrame.document.execCommand(print); 源码:html      { font: 9pt / 13pt Verdana; color: black }input        { font: 9pt Verdana; color: black; width: 115pt }i

浪子专栏 780

最新扣子智能体教程:手把手教你接入抖音评论区,实现自动回复

摘要:本文介绍如何利用扣子(Coze)平台搭建智能体实现抖音评论自动回复。从准备工作(账号注册、权限申请)到智能体创建(提示词优化、模型选择),再到抖音API接入和自动回复逻辑设置,详细说明了每个步骤的操作方法。文章还提供了回复模板示例和优化建议,帮助提升互动效率。通过这套方案,创作者可以显著减轻评论区管理压力,增强用户互动体验。(149字)

互联网架构师笔记 983

Javascript获取IFrame内容(兼容IE&FF) (转)

在网上找到在IE下操作IFrame内容的代码: document.frames["MyIFrame"].document.getElementById("s").style.color="blue";但是这在Firefox下无效。所以,想到在Firefox下用FireBug来调试。经过调试发现在Firefox下可用以下代码来实现: document.getEl...

anhuang5101的博客 355

热更新方案 HybridCLR 学习教程 |(一)原理及准备工作

前面文章介绍了热更新相关的知识,包括使用xLua实现热更新实战等 那本文就来介绍一下 热更新方案 HybridCLR(代号wolong,原huatuo)和基本使用方法。 若是想了解更多关于HybridCLR的东西也可以去 官网 详细查阅。

努力前行,总会成为自己心中的那道光 2万+

制作你自己的yolov5数据集并进行训练

项目地址:make-your-yolov5_dataset 一、数据集标注软件 labelImg labelMe 精灵标注助手 更多的标注工具你可以去看:深度学习图像标注工具汇总 、 十个最常用深度学习图像/视频数据标注工具 、 百度一下 在这里我选择使用labelImg 二、数据集标注 下载labelImg 解压,直接打开labelimg.exe labelImg标注数据 标注完成后即可获得VOC格式(生成.xml文件)的数据 目录结构: dataset │ ├─Annotations .

年少的勇气已经用完,剩下的就是三思而后行 1万+

JS操作iframe里的dom

JS操作iframe里的dom一、父级窗口操作iframe里的domJS操作iframe里的dom可是使用contentWindow属性,contentWindow属性是指指定的frame或者iframe所在的window对象,在IE中iframe或者frame的contentWindow属性可以省略,但在Firefox中如果要对iframe对象进行编辑则,必须指定contentWindow属性,c

一个有味道的Weber 3552

RH850从0搭建Autosar开发环境【17】- Davinci Configurator之DCM模块配置详解(下)

RH850从0搭建Autosar开发环境【17】- Davinci Configurator之DCM模块配置详解(下)

weixin_42412049的博客 2379

JS跨域访问操作iframe里的dom【转】

很多人一直都有个想法,要是可以随心所欲的操作iframe就好了。这样静态页面也就有了相当于后台动态页面php,jsp,asp中include,require实现统一多页面布局的能力。通过Javascript的帮忙我们可以像后台一样动态加载操作iframe对象属性src指向的html页面的内容。这样的操作需要提供两个页面,一个页面是iframe所在页面(页面名称:iPage.html),另一个页面是...

iteye_10194的博客 2034

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

JS跨域访问操作iframe

很多人一直都有个想法,要是可以随心所欲的操作iframe就好了。这样静态页面也就有了相当于后台动态页面php,jsp,asp中include,require实现统一多页面布局的能力。 通过Javascript的帮忙我们可以像后台一样动态加载操作iframe对象属性src指向的html页面的内容。这样的操作需要提供两个页面,一个页面是iframe所在页面(页面名称:iPage.html),另一个页

1万+

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

js操作Iframe(获取Iframe中的节点内容)

在web开发中,经常会用到iframe,难免会碰到需要在父窗口中使用iframe中的元素、或者在iframe框架中使用父窗口的元素 js 在父窗口中获取iframe中的元素 1、 格式:window.frames[“iframe的name值”].document.getElementByIdx_x(“iframe中控件的ID”).click(); 实例:window.frames[“ifm”].d...

qq_41585377的博客 1万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

javascript之JS操作iframe

JS操作iframe 1. 获得iframe的window对象 2. 获得iframe的document对象 3. iframe中获得父页面的window对象 4. 获得iframe在父页面中的html标签 5. iframe的onload事件 6. frames 参考文章 1. 获得iframe的windo...

iteye_3352的博客 998

利用JQuery、js操作iframe父页面、子页面的元素和方法汇总

iframe在复合文档中经常用到,利用jquery操作iframe可以大幅提高效率,本文主要给大家分享了关于简单使用JQUERY来操作IFRAME的一些记录,这个使用纯JS也可以实现。下面话不多说了,来一起看看详细的介绍吧。 第一、在iframe中查找父页面元素的方法: 1 $('#id', window.parent.document) 第二、在父页...

lyn1772671980的博客 3025

用JS操作FRAME中的IFRAME及其内容

问:想通过在地址栏输入一段JS来设置一下页面里某个FRAME中的IFRAME的URL和里面某个TEXT的值,然后点击提交按钮。注意:页面是其它网站的,不要给出一些改动页面代码的答案。具体情况如下:主页面.htm: main.jsp :    要求: 1.当打开主页面后,在地址栏里输入一段JS,来改变mainFrame的src为http://.../c.

赵亮的博客专栏(theforever,碧海情天) 1万+

js 操作 iframe

JS操作iframe里的dom<br />发表于: 2010/06/24 23:00 | 发表在: JS与RIA | Tags: Dom , iframe , JavaScript | 被浏览2577次 <br />看到断桥残雪 对我上一篇日志的回复我也学习了一下JS操作iframe里的dom;主要参考了断桥残雪的《用JavaScript在IE和Firefox下进行iframe的DOM操作 》和支付宝UED的《用JS访问操作iframe里的dom 》,非常不错的两篇文章。一、父级窗口

清风的专栏 560

用JS访问操作iframe框架里的dom

通过Javascript的帮忙我们可以像后台一样动态加载操作iframe对象属性src指向的html页面的内容。这样的操作需要提供两个页面,一个页面是iframe所在页面(页面名称:iPage.html),另一个页面是iframe属性src指向页面(页面名称:srcPage.html)。iPage.html,里dom: srcPage.html,里dom:妹妹的一天   早上吃早点

xx_liuhui的专栏 1905

js对iframe及内外父子页面的操作

1.js在iframe子页面操作父页面元素代码: window.parent.document.getElementById(&quot;父页面元素id&quot;); 2.js在父页面获取iframe子页面元素代码如下: window.frames[&quot;iframe_ID&quot;].document.getElementById(&quot;子页面元素id&quot;); 3.jquery在iframe子页面获取父页面元素代码如下 : $..

豆豆熊博客 1910

jquery 操作iframe的几种方法总结选择器

("#mainframe",parent.document.body).contents().find("someID").html()或者 $("#mainframe",parent.document.body).contents().find("someID").val()一个页面中的所有框架以集合的形式作为window 对象的属性提供,例如:window.frames就表示该页面内所有框架的集合,这和表单对象、链接对象、图片对象等是类似的,不同的是,这些集合是 document的属性。

qq_32722591的博客 5033
上一篇: JavaScript定义类的几种方式
下一篇: 11个Javascript树形菜单
friends
博客等级 码龄16年 37粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值