Remote Scripting with IFRAME

( From: http://developer.apple.com/internet/webcontent/iframe.html )


Remote Scripting with IFRAME

As web sites become more and more like traditional applications, the call-response-reload model used in HTTP transactions becomes increasingly cumbersome. Instead of delivering a single dynamic page, the DHTML or JavaScript developer must create a series of separate pages. The flow of the application is interrupted by page reloads whenever the client communicates with the server. Remote scripting provides a solution to this problem, easing development of complex JavaScript applications, and providing a better experience for the end user.

What is Remote Scripting?

Remote Scripting is the process by which a client-side application running in the browser and a server-side application can exchange data without reloading the page. Remote scripting allows you to create complex DHTML interfaces which interact seamlessly with your server.

If you're not clear on exactly what this means, think of the ever-present JavaScript image swap (you've coded one of those, haven't you?). In an image swap, your client-side code requests new data from the server to be displayed on the web page; in this case the request made to the server is for a new image with which you wish to replace an existing image. But what if you could ask the server for something other than an image? What if you could request a block of text? And what if your request could be more than a simple call for data? What if you could submit form data back to the server, have the server process that data and respond with an appropriate message? Of course, all of these things are already possible by relying on page reloads, but remote scripting allows complex interaction with the server that appears as seamless to the user as a simple image swap.

Remote scripting is a form of RPC (Remote Procedure Call), which is a general term used to describe the exchange of data between remote computer systems. Remote scripting opens up a great number of opportunities for the developer. Imagine a news article that can load side bars and graphical information related to the article directly into the web page when the site's visitors request it. Imagine a gallery of photo thumbnails that turn into full-sized images when clicked. Imagine a full-featured, browser-based content management system interface that allows a site administrator to edit web site copy in situ. The possibilities are limited only by the creativity of the developer.

Setting up Remote Scripting

As I'm sure you've gathered, remote scripting is a client/server technology that relies on two distinct components: the server, which is your web server, and the client, which is the JavaScript application in your web page. In remote scripting, you'll be making an RPC from your JavaScript application to your server. You'll need to be versed in both client and server web technologies to get started with remote scripting.

The client-side component is a part of the web page that you want to enable with remote scripting capabilities. It needs to be able to make a call back to the server, usually done via HTTP, and to then be able to receive and deal with the server response, if any. The server component must be ready to receive requests from the client, process the request, and then respond, returning data to the client if needed. The server component can be a script served up by your web server, such as a .php, .asp, or .cgi file, or it can be a dedicated software package that handles only RPC calls, or it can even be a simple database comprised of static files.

As you can see, the requirements for each of these components will vary greatly depending on how you choose to implement your remote scripting system.

Remote Scripting Technology Options

Remote scripting is actually a fairly broad term, and does not necessarily imply the use of any particular technology. Several remote scripting options are available to the web developer:

Java Applet/ActiveX control/Flash By embedding an ActiveX component, a Java applet, or a Flash movie into your web page, all of which are capable of making HTTP requests and interacting with your client-side JavaScript code, you can implement the client component of a remote scripting system. Not all browsers support the technology (called LiveConnect) that allows for interaction between JavaScript and such objects; most notably, IE5 Mac does not support it at all, and NS6 (on all platforms) has such splotchy support it cannot really be called support at all. In addition to those problems, using an embedded object for remote scripting requires the end-user to install additional proprietary software. ActiveX does not work on the Macintosh platform, and Java can cause some difficulties with some versions of Internet Explorer. On the upside, Java and ActiveX can create socket connections with the server, which allows the server to interact with your application even when communication is not initiated by the client component. Unless you're developing in an environment where browser homogeneity can be assumed, these technologies may not be a good choice for remote scripting.

XML-RPC is in many ways the superior choice for remote scripting. It uses XML for encapsulating data, HTTP for its transport mechanism, and can be implemented in a wide variety of platform and software environments. XML-RPS is an open, standards-based technology that is quickly becoming the de-facto method for RPC of all kinds. The down side is that it takes a bit more know-how and work to get it up and running, requiring the installation of XML-RPC libraries on your server and in your client-side code. It also does not work with IE5 on the Macintosh.

Simple HTTP via a hidden IFRAME Using an IFRAME in conjunction with a script on your web server or a database of static HTML files, is by far the easiest of the remote scripting options available. The IFRAME has been part of the HTML specification since version 4 and is supported in nearly all modern browsers. On the server, you can use your scripting language of choice to process page requests made to the IFRAME. In the remainder of this article you'll see how to implement these components.

Using an IFRAME for Remote Scripting

Enough already with the talk! Let's get to the code. I'm going to show you everything you need to know to set up a remote scripting system with an IFRAME. I'll start with the basic set up, and describe some common browser problems and their solutions.

For starters, you'll need two web pages. The first should be called client.html (or some variation thereof, depending on the example). It will be the main working document and will contain nearly all of the scripts. The client.html will be making remote scripting calls using an IFRAME embedded in the document's HTML. The second page will be server.html. In a live server environment, you'd call it server.php, or server.asp, or whatever extension fits your server platform, but in this example we're not using a dynamic server component, so an .html extension is fine.

The client.html file will make RPC calls by passing arguments to server.html in the query string. The server.html will process the RPC, and write out a very simple page which contains script calls back to client.html. This will be clearer after we look at a simple example.

In client.html enter the following:

<script type="text/javascript"> function handleResponse() { alert('this function is called from server.html') } </script> <iframe id="RSIFrame" name="RSIFrame" style="width:0px; height:0px; border: 0px" src="blank.html"></iframe> <a href="server.html" target="RSIFrame">make RPC call</a>

As you can see, in it's simplest form IFRAME remote scripting simply points the TARGET attribute of a link to a hidden IFRAME. You can hide an IFRAME by setting its WIDTH, HEIGHT, and BORDER properties to 0px. Don't use display:none, because NS6 ignores IFRAMEs when the display property is set to none. If you were using the above code with display:none set for the IFRAME, the contents of server.html would load into the main client.html document, not into the IFRAME.

In server.html use the following HTML:

<script type="text/javascript"> window.parent.handleResponse() </script>

The handleResponse() function is found in our client.html page, and we simply use the parentproperty of the IFRAME document's window object to call it. See it in action here. Of course you notice that in this example we are not actually processing anything on the server. If you want, on your server go ahead and change your server page code to something like this (I'm using ASP as an example server scripting language):

<script type="text/javascript"< window.parent.handleResponse('<%=request.servervariables("SERVER_SOFTWARE")%>') </script>

And change the handleResponse() function in client.html to something like this:

<script type="text/javascript"> function handleResponse(msg) { alert(msg) } </script>

You should now get an alert message containing information returned from your server, the results of your first remote procedure call!

Should you want to pass data to server.html, you can either embed it in the query string of the URL specified in your link, or, to allow user interaction, use a form instead of a link, like so:

<form action="server.html" target="RSIFrame"> <input type="text" name="whatever"> </form>

Just like the link, you specify the IFRAME as the target of your form, use server.html to process the form data on the server, and send any data back with the handleResponse() method. More on working with forms later.

Problems and Solutions

You may have already realized that there are some serious problems with this simplest of remote scripting scenarios. Perhaps most seriously, this method renders the "back" and "reload" buttons in most browsers useless. Because the loading of server.html in the IFRAME is added to the browsers history object, hitting the reload button after you've loaded server.html, for instance, reloads server.html in the IFRAME instead of reloading client.html as would be expected.

NOTE: You may or not experience this problem, depending on a combination of factors including your browser version, server platform, HTTP headers, and browser settings. Trust me, if you simply target a link at an IFRAME, some users will have problems with their reload and back buttons.

A new function called callToServer() handles this problem by using the replace() method of the IFRAME document's document object. In addition, instead of creating an IFRAME element in the HTML, I'll let callToServer() create the IFRAME through the wonders of the DOM. Doing so alleviates all the reload and back button problems, and keeps the mark up free from unneeded tags.

Sadly, referencing the IFRAME's document object is no simple task, since IE5, IE5.5, IE6, and NS6 all provide different ways to access it. IE5, both on the Mac and PC, provides the simplest method: IFRAMEs in this browser show up in the document.frames array and have a document property. In IE5.5, IE6 and NS6, you can retrieve the IFRAME element object withdocument.getElementById_x(), then, in NS6, use the object's contentDocument property, and in IE 5.5+, use the document property of the IFRAME object's contentWindow property. That's quite a mouthful, isn't it? Thankfully, it's quite a bit simpler in the actual code:

var IFrameObj; // our IFrame object function callToServer() { if (!document.createElement_x) {return true}; var IFrameDoc; var URL = 'server.html'; if (!IFrameObj && document.createElement_x) { // create the IFrame and assign a reference to the // object to our global variable IFrameObj. // this will only happen the first time // callToServer() is called try { var tempIFrame=document.createElement_x('iframe'); tempIFrame.setAttribute('id','RSIFrame'); tempIFrame.style.border='0px'; tempIFrame.style.width='0px'; tempIFrame.style.height='0px'; IFrameObj = document.body.appendChild(tempIFrame); if (document.frames) { // this is for IE5 Mac, because it will only // allow access to the document object // of the IFrame if we access it through // the document.frames array IFrameObj = document.frames['RSIFrame']; } } catch(exception) { // This is for IE5 PC, which does not allow dynamic creation // and manipulation of an iframe object. Instead, we'll fake // it up by creating our own objects. iframeHTML='\<iframe id="RSIFrame" style="'; iframeHTML+='border:0px;'; iframeHTML+='width:0px;'; iframeHTML+='height:0px;'; iframeHTML+='"><\/iframe>'; document.body.innerHTML+=iframeHTML; IFrameObj = new Object(); IFrameObj.document = new Object(); IFrameObj.document.location = new Object(); IFrameObj.document.location.iframe = document.getElementById_x('RSIFrame'); IFrameObj.document.location.replace = function(location) { this.iframe.src = location; } } } if (navigator.userAgent.indexOf('Gecko') !=-1 && !IFrameObj.contentDocument) { // we have to give NS6 a fraction of a second // to recognize the new IFrame setTimeout('callToServer()',10); return false; } if (IFrameObj.contentDocument) { // For NS6 IFrameDoc = IFrameObj.contentDocument; } else if (IFrameObj.contentWindow) { // For IE5.5 and IE6 IFrameDoc = IFrameObj.contentWindow.document; } else if (IFrameObj.document) { // For IE5 IFrameDoc = IFrameObj.document; } else { return true; } IFrameDoc.location.replace(URL); return false; }

With that function added to client.html, and the IFRAME tag removed, you now can simply addcallToServer() to the link as an onclick event handler that returns false if the IFRAME exists and can be loaded with server.html, and otherwise returns true, allowing the link to function as normal. I've removed the TARGET attribute of the link, and changed the href also, pointing it to the blank page. You'll probably want to point the link to a page on your server which explains to the user that their browser does not support Advanced IFRAME Remote Scripting Technology, or better yet, which performs the same tasks as server.html and then redirects the user back to client.html.

<a οnclick="return callToServer();" href="blank.html">make RPC call</a>

You can see this more complete code in action here.

Using a Form to Pass Data to the Server

Now that you've got the basic framework in place, it would be nice to add a form to send data to the server and receive back a useful response. You can't simply target the IFRAME with a form anymore, as you've learned, and you are limited to passing data to server.html via the query string. What you need is a function to shuffle values from a form into a properly formatted query string which can then append to the URL passed to the replace() method of the IFRAME'sdocument.location property.

function buildQueryString(theFormName) { theForm = document.forms[theFormName]; var qs = '' for (e=0;e<theForm.elements.length;e++) { if (theForm.elements[e].name!='') { qs+=(qs=='')?'?':'&' qs+=theForm.elements[e].name+'='+escape(theForm.elements[e].value) } } return qs }

The function buildQueryString() takes one parameter, the name of the form from which you wish to grab data. It iterates through each element of that form, and for those elements with nameproperties, it adds a new name/value pair to a string called qs. The function then returns qs. With buildQueryString() in place, you can now change callToServer() to also accept a form name as parameter, and then within callToServer() we change the line

var URL = 'server.html';

to

var URL = 'server.html' + buildQueryString(theFormName);

Next, create a form like so:

<form name="emailForm" id="emailForm" action="server.html" οnsubmit="return callToServer(this.name)"> Your name:<br> <input type="text" name="realname"><br> Your message:<br> <textarea name="message" cols="50" rows="10"></textarea><br><br> <input type="submit" value="submit"> </form>

Now we have a form that, when submitted, sends its data to the server through a hidden IFRAME. Your server can act on that data however you wish, interacting with client.html by callinghandleResponse(). Here's an example that sends form data back to the server, hides the form, and displays a success message.

Looking at the code, you'll see that I changed the handleResponse() function in the client page so that instead of popping up an alert message it now takes care of hiding and showing the relevant page elements.

A Final Example

To help you see the possibilities that Remote Scripting affords you the developer, I've worked up one final example that loads data from a database of static HTML files.

Select a state from this menu:  Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming 

Once a state has been selected, the multiple select list below will be populated with a partial list of ZIP code names drawn from a database of html files that are loaded via a hidden IFRAME. (ZIP code data drawn from sources on  the US Census Bureau site). 

Selecting a state from the drop down menu invokes the callToServer() function, which, instead of calling a single script on the server, loads into our hidden IFRAME one of 51 HTML files which contain ZIP code data for each of the 50 states (plus DC). The onload event of these files calls the handleResponse() function, which parses out the data in the loaded file and inserts new option elements into a multiple SELECT list. This example also resides here, where you can study the code in detail.

That should give you a taste for what can be done with RPC. Once you start playing around with it on your server, you'll really get a feel for the power in your hands. Try making calls to your server to retrieve data from a database, passing the data back to your client page with a call to the handleResponse() function, and then adding that data to your client page using DOM methods like those detailed in these Internet Developer articles: DOM-2 Part 1 and DOM-2 Part 2. Be sure to use your new skills for good and not evil!

Further Reading and Outside Resources

If you'd like to explore Remote Scripting further, let me recommend these sites to you:

  • Brent Ashley's Remote Scripting Resources, which contains Brent's own RSLite and Javascript Remote Scripting (JSRS) tools along with links to other Remote Scripting resources.
  • Virtual Cowboys' vcXMLRPC Library, a very nice implementation of XML-RPC in javascript.

Update

The code in this article, including examples, has been changed since the article first ran on 1/28/02. The original version failed in Inernet Explorer 5 for PC (IE5 mac works fine, as do IE5.5 and IE6 on the PC and NS6 and Mozilla) If you've incorporated any of the code from article into you projects, you'll want to update the callToServer() function as follows: look for the code listed directly below, and replace it to with the code block that follows it at the bottom of this page.

Replace this Code...

if (!IFrameObj && document.createElement_x) { // create the IFrame and assign a reference to the // object to our global variable IFrameObj. // this will only happen the first time // callToServer() is called var tempIFrame=document.createElement_x('iframe'); tempIFrame.setAttribute('id','RSIFrame'); tempIFrame.style.border='0px'; tempIFrame.style.width='0px'; tempIFrame.style.height='0px'; IFrameObj = document.body.appendChild(tempIFrame); if (document.frames) { // this is for IE5 Mac, because it will only // allow access to the document object // of the IFrame if we access it through // the document.frames array IFrameObj = document.frames['RSIFrame']; } }

...with this Code

if (!IFrameObj && document.createElement_x) { // create the IFrame and assign a reference to the // object to our global variable IFrameObj. // this will only happen the first time // callToServer() is called try { var tempIFrame=document.createElement_x('iframe'); tempIFrame.setAttribute('id','RSIFrame'); tempIFrame.style.border='0px'; tempIFrame.style.width='0px'; tempIFrame.style.height='0px'; IFrameObj = document.body.appendChild(tempIFrame); if (document.frames) { // this is for IE5 Mac, because it will only // allow access to the document object // of the IFrame if we access it through // the document.frames array IFrameObj = document.frames['RSIFrame']; } } catch(exception) { // This is for IE5 PC, which does not allow dynamic creation // and manipulation of an iframe object. Instead, we'll fake // it up by creating our own objects. iframeHTML='\<iframe id="RSIFrame" style="'; iframeHTML+='border:0px;'; iframeHTML+='width:0px;'; iframeHTML+='height:0px;'; iframeHTML+='"><\/iframe>'; document.body.innerHTML+=iframeHTML; IFrameObj = new Object(); IFrameObj.document = new Object(); IFrameObj.document.location = new Object(); IFrameObj.document.location.iframe = document.getElementById_x('RSIFrame'); IFrameObj.document.location.replace = function(location) { this.iframe.src = location; } } }

基于Simulink的PR(比例谐振)控制器在单相整流中的应用 本文详细介绍了基于Simulink的单相整流系统中PR(比例谐振)控制器的设计与实现方法。首先阐述了PR控制器相较于传统PI控制器的优势,能够有效消除交流信号跟踪中的稳态误差。接着系统讲解了PR控制器的传递函数原理、实用型设计(带带宽)及参数整定方法。通过Simulink建模步骤,包括主功率电路搭建、电压外环PI设计、电流指令生成、PR控制器实现(推荐MATLAB Function方法)和SPWM调制等关键环节。仿真对比显示PR控制在电流跟踪精度(THD仅1.9%)、功率因数(0.998)和动态响应(突变恢 阅读详情

相关推荐

比较几款国际主流的电子元器件及物料清单管理软件 – 工具汇总

Arenasolution 老牌的基于云计算物料清单管理软件,bom.com就是他们家的,10天免费试用,功能被分成4个不同的产品, 和传统ERP功能上有重叠,偏向于物流生产规划,一定程度可以取代ERP的生产规划模块,平均价格70美元/月/席位。网页客户端,不支持离线   SiliconExpert 曾经的老牌物料清单管理软件,后被Arrow 收购,14天免费试用,功能被分成4个不同的产品

u012062784的专栏 7243

整理iOS 错误警告

1. App installation failed A valid provisioning profile for this executable was not found. 原因是测试手机上没有安装证书,也就是证书中没有包含新手机导致 到portal->devices选项中手动添加新手机,或者通过orginzer->devices->(your device)->add to por

芜湖梁朝伟的博客 1万+

CS5212芯片实战:手把手教你设计DP转VGA转换电路(附完整原理图)

本文详细介绍了CS5212芯片在DP转VGA转换电路设计中的实战应用,包括芯片架构解析、核心电路设计要点、PCB布局与电磁兼容设计、调试技巧及进阶应用开发。通过完整的原理图和实用设计指南,帮助工程师快速掌握高可靠转换器的设计方法,特别适合需要国产化替代方案的场景。

weixin_30576827的博客 399

VC中使用XMLRPC提供接口(XMLPRC++)

首先从XMLRPC官网http://www.xmlrpc.com/,或者http://sourceforge.net/projects/xmlrpcpp/网站下载XMLRPC++0.7。解压。解压之后必须用vc6.0来运行编译,会生成一个xmlrpc.lib的文件,这个文件即为下面所需要用到的。 1.熟悉XMLRPC 可以运行xmlrpc.dsw工程中的的例子...

weixin_33884611的博客 266

ConnectionResetError 10054 根因分析与全链路防御指南

ConnectionResetError(错误码10054)是TCP协议中服务端主动发送RST包导致的强制断连,本质并非网络连接失败,而是服务端基于空闲超时、连接满载、TLS协商失败等策略做出的确定性终止决策。理解其底层原理有助于跳出‘重试’误区,转向连接生命周期管理。该错误高频出现在HTTP长连接、WebSocket、第三方API对接等场景,尤其在Nginx反向代理、负载均衡器(如AWS ALB)、WAF设备及内核conntrack机制下极易触发。本文结合Wireshark抓包分析、客户端心跳保鲜、协议指

weixin_30225755的博客 649

量化交易新手必看:如何用Python快速接入XTP极速交易系统(附避坑指南)

本文为量化交易新手提供了使用Python快速接入中泰证券XTP极速交易系统的完整指南。文章详细介绍了XTP系统的微秒级性能优势、与CTP系统的核心区别,并逐步讲解了环境配置、API连接、资金查询、下单撤单等关键步骤,同时分享了网络维护、订单处理等实战避坑技巧,帮助开发者高效对接专业交易柜台。

life6的博客 666

快速上手,使用 JS 配合XML-RPC(JSP)实现AJAX类型应用

    前段时间,为了能提高用户操作的友好度写了大量的Js+XMLHTTP类型的应用。随着项目的扩大,细节的补充,这些代码越来越难维护,考虑到XML-RPC相对于SOAP的轻便,相对于私有协议的标准性,兼之以前曾在Asp框架下实现过一些RPC应用,所以考虑将所有的同类型应用都统一处理,换为XML-RPC应用。    首先,完成服务器端,在网上查资料,Apache XML-RPC可以完成此功能。找到

faust的专栏 4505

当C#遇见声音魔法:从麦克风到文字的0.1秒奇幻漂流

为什么选300Hz?因为人声基频通常在85-255Hz,但清脆的“啊”可能到2kHz,所以300Hz是安全区!(参考知识库[1])

墨夶的博客 368

VC中使用XMLRPC

我目前的工作任务是使用XMLRPC实现与其他系统的接口。以前没有用过XMLRPC。两天半时间才搞定。把步骤记录下来以备以后参考。 首先从XMLRPC官网http://www.xmlrpc.com/,或者http://sourceforge.net/projects/xmlr

liuling_8008的专栏 2476

五十天精通硬件设计第6天-放大器知识及选型

运算放大器(Operational Amplifier,简称运放)是一种高增益的直流耦合差分放大器,广泛应用于信号处理、滤波、比较、积分、微分等电路中。

whm128的博客 601

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

Remote Scripting with IFrame

一种实现与服务器交互的技术,在ajax没有流行之前的常用技术,今天整理硬盘发现了它,共享一下。http://developer.apple.com/internet/webcontent/iframe.html

jTeam的专栏 1310

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

[收藏]Remote scripting with IFRAME

原文地址:http://developer.apple.com/internet/webcontent/iframe.html转载过来的效果可能不好,它里面有些例子代码,可以现场演示的,建议大家看原地址。:)As web sites become more and more like traditional applications, the call-response-reload model

心如止水--coofucoo的专栏 2928

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

终极Remote DOM入门教程:从安装到第一个跨iframe组件渲染

Remote DOM是一个基于DOM的实用工具集合,用于在JavaScript环境之间同步元素。通过Remote DOM,开发者可以轻松实现跨iframe等不同JavaScript环境的组件渲染与通信,为构建复杂的Web应用提供了强大的支持。 ## 📦 快速安装Remote DOM 要开始使用Remote DOM,首先需要安装核心包。Remote DOM支持npm、pnpm和yarn等多种包

gitblog_00737的博客 1013

使用iframe call server及iframe target使用例

使用iframe call server及iframe target使用例 //iframe.htm<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"...

weixin_30354675的博客 144

bootstrap remote用法是什么

bootstrap remote的用法:首先设置主页面,并放置好一个模态框;然后在主页面上放一个按钮来触发这个模态窗口的显示;接着给这个按钮绑定点击事件;最后通过“remote: '/sys/toAddUser'”从远程加载内容的地址即可。 本教程操作环境:Windows7系统、bootsrap3.3.7版,该方法适用于所有品牌电脑。 推荐:《bootstrap视频教程》《css视频教程》 Bootstrap的Modal这个模态窗组件还是很好用的,但在开发的过程中模态窗中的内容大部分都是从后端加载的。要实现

jycg789的博客 103

Remote DOM与React集成指南:构建跨环境UI的完整实践

Remote DOM是一个强大的跨环境UI渲染解决方案,它允许开发者在不同环境(如主应用与iframe、Web Worker或跨域场景)之间共享和渲染UI组件。本指南将详细介绍如何将Remote DOM与React框架无缝集成,帮助你构建高效、灵活的跨环境用户界面。 ## 为什么选择Remote DOM与React集成? 在现代Web应用开发中,我们经常面临需要在不同环境间共享UI组件的场景。

gitblog_01073的博客 697

揭秘Remote DOM工作原理:从DOM Polyfill到双向通信机制

Remote DOM是一项革新性的技术,它通过创新性的DOM Polyfill实现和高效的双向通信机制,彻底改变了前端开发中跨上下文交互的方式。无论是在iframe、Web Worker还是其他隔离环境中,Remote DOM都能提供无缝的DOM操作体验,让开发者能够像操作本地DOM一样轻松控制远程环境中的元素。 ## 深入理解Remote DOM的核心架构 Remote DOM的核心魅力在于

gitblog_00142的博客 1061

SignalRemoteReceiver详解:响应式状态管理与Remote DOM的完美结合

SignalRemoteReceiver是GitHub加速计划/re/remote-ui项目中一个强大的工具,它将远程元素存储为基本的JavaScript表示形式,并将可变属性和子节点存储在信号中。这种独特的设计实现了响应式状态管理与Remote DOM的完美结合,为开发者提供了高效处理远程UI组件的新方式。 ## 什么是SignalRemoteReceiver? SignalRemoteRe

gitblog_00251的博客 1161

js代码让iframe窗口全屏

最近在工作中使用novnc远程连接电脑,在ifrmae中嵌入novnc页面,点击全屏按钮,能够让iframe页面全屏。 我的思路是: 1)点击全屏按钮,让当前页面全屏; 2)将iframe重新fixed定位,高宽设置100%,left top为0,定位到铺满当前浏览器全屏; 3)将全屏按钮也一起定位到右上角; html代码 : 远程详情

十年树木的博客 3万+
上一篇: HTTP multipart/form-data 上传方式说明
下一篇: Single Sign-On
excpp
博客等级 码龄15年 0粉丝 61原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址