iframe优缺点

iframe标签(属性介绍(sandbox、srcdoc、scrolling)、iframe对象、onload事件、父集获取iframe内节点(同源和不同源情况)、domain修改规则和示例) 目录 iframe标签 属性简要汇总 部分属性详细介绍 align fameborder height|width marginheight|width name sandbox scrolling srcdoc iframe对象 属性汇总 onload事件 父集获取iframe内节点 同源情况(域名和端口号相同) 不同源(父子域名、端口号相同) 不同源(万能) iframe优缺点和应用场景、设置网页是否能作为iframe(X-Frame-Options)、点击... 阅读详情

iframe基本内涵

通常我们使用iframe直接直接在页面嵌套iframe标签指定src就可以了。

 <iframe src="demo_iframe_sandbox.htm"></iframe>

iframe中的属性:

1.frameborder:是否显示边框,1(yes),0(no)
2.height:框架作为一个普通元素的高度,建议在使用css设置。
3.width:框架作为一个普通元素的宽度,建议使用css设置。
4.name:框架的名称,window.frames[name]时专用的属性。
5.scrolling:框架的是否滚动。yes,no,auto。
6.src:内框架的地址,可以使页面地址,也可以是图片的地址。
7.srcdoc , 用来替代原来HTML body里面的内容。但是IE不支持, 不过也没什么卵用
8.sandbox: 对iframe进行一些列限制,IE10+支持

iframe的优点:

1.iframe能够把嵌入的网页原样展现出来;

2.模块分离,便于更改,如果有多个网页引用iframe,只需要修改iframe的内容,就可以实现调用的每一个页面内容的更改,方便快捷;

3.网页如果为了统一风格,头部和版本都是一样的,就可以写成一个页面,用iframe来嵌套,增加代码的可重用;

4.如果遇到加载缓慢的第三方内容如图标和广告,这些问题可以由iframe来解决;

5.重载页面时不需要重载整个页面,只需要重载页面中的一个框架页;

6.方便制作导航栏。

iframe的缺点:

1.会产生很多页面,不容易管理。

2.iframe框架结构有时会让人感到迷惑,如果框架个数多的话,可能会出现上下、左右滚动条,会分散访问者的注意力,用户体验度差。

3.代码复杂,无法被一些搜索引擎索引到,这一点很关键,现在的搜索引擎爬虫还不能很好的处理iframe中的内容,所以使用iframe会不利于搜索引擎优化。

4.很多的移动设备(PDA 手机)无法完全显示框架,设备兼容性差。

5.iframe框架页面会增加服务器的http请求,对于大型网站是不可取的。

分析了这么多,现在基本上都是用Ajax来代替iframe,所以iframe已经渐渐的退出了前端开发

使用替代方案代替iframe编程 Ajax是一种在网页上异步加载数据的技术,它可以通过JavaScript发送HTTP请求并在不刷新整个页面的情况下更新部分内容。您可以使用Ajax来加载其他网页或内容,并将其插入到当前网页中的特定区域。如果您的网站使用了JavaScript模块化的开发方式,您可以将其他网页或内容封装为一个JavaScript模块,并在需要的地方进行引用和调用。通过使用服务器端包含,您可以将其他网页或内容包含到当前网页中的特定位置,而无需使用。例如,React框架可以使用组件化的方式实现页面的模块化和嵌入。 阅读详情

相关推荐

minist手写数字的识别代码复现(pytorch 版本)

电脑系统:Windows 10语言环境:Python 3.8.18编译器:jupyter notebook深度学习环境:torch == 1.13.1+cu116显卡及显存: Tesla V100-PCIE-32GB卷积神经网络(Convolutional Neural Network,CNN或ConvNet)是一种 具有局部连接、权重共享等特性的深层前馈神经网络. 目前的卷积神经网络一般是由卷积层、汇聚层和全连接层交叉堆叠而成的 前馈神经网络。

2202_75521293的博客 2620

iframe 优点、缺点

一、iframe使用 <body> <iframe src="https://blog.youkuaiyun.com/weixin_50580285/article/details/117792145?spm=1001.2014.3001.5501" frameborder="0" width="100%" height="700px"></iframe> </body> 展示效果图: 二、iframe的优点 iframe能够原封不动的把嵌

朵拉多的博客 502

华为Atlas 300I推理卡驱动安装避坑指南:不同安装方式的选择与优化

本文详细解析华为Atlas 300I推理卡驱动安装的三种主流方式(.run、.rpm和源码编译),提供关键环境检查步骤、安装流程优化建议及常见问题解决方案,帮助开发者高效完成芯片推理卡部署并规避典型安装陷阱。

q9w8e7r6t5的博客 434

iframe在ios的兼容性问题

开发背景:cordova+vue 混合开发ios app 问题简述:在xcode模拟器(真机)上iframe内容不显示,以及内容显示不完全 1、在xcode模拟器(真机)上iframe内容不显示解决方案: 1-1在cordova 项目的config.xml中配置 <access origin="*" subdomains="true" /> <allow-navigat...

qq_41909079的博客 2535

PX4飞控与MAVROS实战:从零搭建无人机ROS通信环境(附常见报错解决)

本文详细介绍了如何从零搭建PX4飞控与ROS的通信环境,重点解析了MAVROS的安装、硬件连接、串口权限配置以及坐标系转换等核心步骤。针对GeographicLib数据下载失败、串口权限不足等常见报错提供了实用解决方案,并附有Offboard模式控制的代码示例,帮助开发者快速建立稳定的无人机ROS开发环境。

dapp9builder的博客 336

保姆级教程:用GPU-Burn给你的NVIDIA Tesla服务器做个“压力体检”(附温度功耗监控脚本)

本文提供了一份详细的GPU服务器压力测试指南,重点介绍如何使用GPU-Burn工具对NVIDIA Tesla服务器进行全面的性能测试和温度功耗监控。从环境部署、多GPU测试策略到专业级监控指标解析,帮助运维人员构建标准化的GPU健康评估体系,确保AI训练和科学计算等关键业务的稳定性。

weixin_30619101的博客 397

JS中的iframe的src属性和srcdoc

一直以为是event.preventDefault()的问题,结果弄了一个下午都不是,调试也调试不出啥问题,然后又看到网上说可以改空字符串,结果试了半天也不行,哎,学艺不精的错。

qq_36148463的博客 1625

YOLOv8训练流程-原理解析[目标检测理论篇]

本篇文章主要介绍了YOLOv8训练的流程,主要介绍了Task Aligned Assigner正负样本匹配策略以及YOLOv8的损失计算。

ice 4518

使用iframe的优缺点,为什么少用iframe以及iframe和frame的区别

<frame name="frame1" src="http://gongxquan.blog.163.com/test1.htm"/> <frame name="frame2" src="http://gongxquan.blog.163.com/test2.htm"/>

2646

uni-app - 最详细 H5 网页接入微信登录功能,提供公众号配置与详细注释示例代码(移动端网页实现点击登录按钮后 调用微信公众号授权登录功能 详细讲解接入流程与详细示例代码)官方最新超级详细教程

uniapp中H5微信登录,uniapp H5微信授权登录,微信公众号第三方网页(H5)授权登录(OAuth2.0)流程及逻辑详细教程,UNIAPP 开发H5 怎么实现微信公众号登录功能,uniapp如何实现H5网页的公众号微信登录,怎么做uniapp微信登录,uniapp h5项目怎么实现微信登录的功能,uniapp微信浏览器H5授权微信登录,UniApp开发H5接入微信登录的全过程,uniapp的H5页面使用微信登录,uniapp H5微信授权登录,H5之微信授权登陆 (uniapp网页版微信授权登录)

🏆 前端领域优质创作者 7413

华为OD机试新系统真题 【LLM推理批次最大化】

华为OD机试 新系统真题【LLM推理批次最大化】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为OD机试真题【LLM推理批次最大化】多语言题解。

qq_45776114的博客 575

浅谈iframe的优缺点及应用场景

转载地址:http://www.miuu.club/Blog/articles/id/46.html 浅谈iframe的优缺点及应用场景 对iframe的优缺点及应用场景的一点小结 iframe 创建包含另外一个文档的内联框架(即行内框架),简而言之,iframe标签是框架的一种形式,一般用来包含别的页面。 一、使用iframe的优缺点 优点:  1.iframe能够把嵌入的网页原...

baxiadsy_csdn的博客 2万+

华为OD机试真题 新系统 2026-08-16 Python&JS【智能家居模式调度优化】

智能家居系统中有多个自动化联动模式,每个模式 modes[i]=[start_time,end_time,power],表示它在左闭右开区间 [start_time,end_time) 内持续消耗固定功率 power。

MISAYAONE的博客 86

iframe 的优缺点有哪些

iframe的优缺点有哪些? 优点: iframe能原封不动的把嵌入的网页展现出来 如果有多个页面都用iframe 那么只需要修改ifame的内容就可以调用每一个页面内容的修改 网页若是为了统一风格,根部跟版本都一样,就可以写成一个页面,用iframe来嵌套可以增加代码的重复使用。 iframe可以解决加载缓慢的第三方内容(图标和广告) 缺点: ①会产生很多页面不易管理; ②iframe框架结构有时会让人感到迷惑,如果框架个数多的话,可能会出现上下、左右滚动条,会分散访问者的注意...

weixin_49757430的博客 557

深度学习工具包 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")

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

iframe框架及优缺点

iframe框架及优缺点 HTML5不再支持使用frame,关于frame与iframe的区别,可以参阅 iframe与frame的区别 基本使用 src:规定在iframe中显示的文档的URL。 frameborder:规定是否显示框架周围的边框。 scrolling:规定是否在 iframe 中显示滚动条。 width:规定iframe的宽度,建议使用CSS替代。 height:规定ifr...

WindRunnerMax 2441

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

iframe的优缺点

iframe的优点: 1.iframe能够原封不动的把嵌入的网页展现出来。 2.如果有多个网页引用iframe,那么只需要修改iframe的内容,就可以实现调用每一个页面的更改,方便快捷。 3.网页如果为了统一风格,头部和版本都是一样的,就可以写成一个页面,用iframe嵌套,可以增加代码的可重用。 4.如果遇到加载缓慢的第三方内容,如图标或广告,这些问题可以由iframe来解决。 5....

麋鹿鲁哟的博客 957

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

iframe基本用法及优缺点

是 HTML 中用来在网页中嵌套另一个 HTML 文档的元素。其主要功能是可以加载其他网页内容并显示在当前页面内。

专注 824

使用iframe的优缺点,为什么少用iframe以及iframe和frame的区别。

出处:http://gongxquan.blog.163.com/blog/static/2108462532012111643039216 使用iframe的优缺点,为什么少用iframe以及iframe和frame的区别。 注:HTML5不再支持使用frame,iframe只有src 属性 一、使用iframe的优缺点 优点: 1.程序

work hard 6万+

iframe标签的使用及优缺点

1、 iframe 元素会创建包含另外一个文档的内联框架(即行内框架)。 2、优点缺点 优点:1、支持任何浏览器 2、原封不动的把嵌入的网页展现出来 3、重载页面时不需要重载整个页面,只需要重载页面中的一个框架页(减少了数据的传输,增加了网页下载速度 缺点:1、页面复杂度高,不容易管理 2、页面加载速度相对frame较慢...

lz的博客 2311

iframe 有哪些优缺点?

iframe 有哪些优缺点?

qq_52449203的博客 721

iframe的优缺点及改进方法

iframe的缺点 1、页面样式调试麻烦,出现多个滚动条; 2、浏览器的后退按钮失效; 3、过多会增加服务器的HTTP请求; 4、小型的移动设备无法完全显示框架; 5、产生多个页面,不易管理; 6、不容易打印; 7、代码复杂,无法被一些搜索引擎解读。 iframe的优点: 1.iframe能够原封不动的把嵌入的网页展现出来。 2.如果有多个网页引

katara1109的博客 1万+

iframe 有那些优缺点?

iframe 元素会创建包含另外一个文档的内联框架(即行内框架)。 优点: (1)程序调入静态页面比较方便; (2)页面和程序分离; 缺点: (1) iframe 会阻塞主页面的 onload 事件。window 的 onload 事件需要在所有 iframe 加载完毕后(包含里面的元素)才会触发。在 Safari 和 Chrome 里,通过 JavaScript 动态 设置 iframe 的 src 可以避免这种阻塞情况。 (2) 搜索引擎的检索程序无法解读这种页面,不利于网页的

CjBkl的博客 761
上一篇: 项目中如何修改element-ui的默认样式
@qmt
博客等级 码龄6年 3粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值