通过JavaScript编写HTML页面的对象标签? 我已经使用iFrames和Objects将网页加载到另一个页面。 我想要做类似但不加载uri,而是写页面,< HTML> ....到...< / HTML>通过JavaScript函数。 这两个标签中的任何一个都可以吗? 谢谢, gsb
解决方案" gsb" < gs*@QWest>写道: 通过JavaScript写HTML页面的对象标签? 我已经使用iFrames和Objects将网页加载到另一个页面。 />我想做类似但不加载uri,而是写页面,< HTML> ...到...< / HTML>通过JavaScript函数。这两个标签中的任何一个都可以吗?
使用iframe。 --- < iframe id =" foo" name =" foo">< / iframe> < script type =" text / javascript"> 函数writeDoc() { var doc = frames [''foo'']。document; doc.open(); doc.write(" ;<!DOCTYPE ...>< html> ....有趣的内容!< / html>"); doc.close(); } < / script> < input type =" button"值= QUOT;插入" onclick =" writeDoc()"> --- 在IE 6,Mozilla FB和Opera 7中测试过。 Mozilla是一个需要iframe上的name属性 才能通过框架集合访问它。 / L - Lasse Reichstein Nielsen - lr*@hotpop DHTML死亡颜色:< URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html> ''没有判断的信仰只会降低精神神圣。''
这对一个对象或只是一个iFrame有效吗? 再次感谢, gsb " Lasse Reichstein Nielsen" < lr*@hotpop>在消息中写道 news:oe ********** @ hotpop ... " gsb" < gs*@QWest>写道: 通过JavaScript写HTML页面的对象标签? 我已经使用iFrames和Objects将网页加载到另一个页面。 />我想做类似但不加载uri,而是写页面,< HTML> ...到...< / HTML>通过JavaScript函数。这两个标签中的任何一个都可以吗?使用iframe。 --- < iframe id =" foo" name =" foo">< / iframe> < script type =" text / javascript"> 函数writeDoc(){ var doc = frames [''foo'']。document; doc.open(); doc.write("<!DOCTYPE ...>< html> ....有趣的内容!< / html>"); doc.close(); } < / script> < input type =" button"值= QUOT;插入" onclick =" writeDoc()"> --- 在IE 6,Mozilla FB和Opera 7中测试过。 Mozilla需要iframe上的name属性通过框架集合访问它。 / L - Lasse Reichstein Nielsen - lr*@hotpop DHTML死亡颜色:< URL:http://www.infimum.dk/HTML/rasterTriangleDOM。 HTML> 没有判断的信仰只会降低精神神圣。
" gsb" < gs*@QWest>写道: 请不要发帖。 这对一个对象,还是仅仅是一个iFrame?
可能只有iframe。它通过帧集合访问嵌入页面的文档对象 。 我对物体没有多少经验,但我的印象是 嵌入了object标签的页面不容易访问 通过脚本编写 - 因为该对象可以容纳这么多不同的b / b 类型的数据,那里是不是简单的方法来访问 那里的数据。 / L - Lasse Reichstein Nielsen - lr*@hotpop DHTML死亡颜色:< URL:http:/ /www.infimum.dk/HTML/rasterTriangleDOM.html> ''没有判断的信仰只会降低精神神圣。''
Object tag to write HTML page to via JavaScript? I''ve used iFrames and Objects to load web pages into another page. I want to do similar but not load a uri, rather write the page, <HTML> ....to...</HTML> via a JavaScript function. Is this possible with either of these two tags? Thanks, gsb
解决方案 "gsb" <gs*@QWest> writes: Object tag to write HTML page to via JavaScript? I''ve used iFrames and Objects to load web pages into another page. I want to do similar but not load a uri, rather write the page, <HTML> ...to...</HTML> via a JavaScript function. Is this possible with either of these two tags?Use an iframe. --- <iframe id="foo" name="foo"></iframe> <script type="text/javascript"> function writeDoc() { var doc = frames[''foo''].document; doc.open(); doc.write("<!DOCTYPE ... ><html> ....funny content! </html>"); doc.close(); } </script> <input type="button" value="insert" onclick="writeDoc()"> --- Tested in IE 6, Mozilla FB and Opera 7. Mozilla is the one that requires the name attribute on the iframe in order to access it through the frames collection. /L -- Lasse Reichstein Nielsen - lr*@hotpop DHTML Death Colors: <URL:www.infimum.dk/HTML/rasterTriangleDOM.html> ''Faith without judgement merely degrades the spirit divine.''
Does that work with an object, or just an iFrame? Thanks again, gsb "Lasse Reichstein Nielsen" <lr*@hotpop> wrote in message news:oe**********@hotpop... "gsb" <gs*@QWest> writes: Object tag to write HTML page to via JavaScript? I''ve used iFrames and Objects to load web pages into another page. I want to do similar but not load a uri, rather write the page, <HTML> ...to...</HTML> via a JavaScript function. Is this possible with either of these two tags? Use an iframe. --- <iframe id="foo" name="foo"></iframe> <script type="text/javascript"> function writeDoc() { var doc = frames[''foo''].document; doc.open(); doc.write("<!DOCTYPE ... ><html> ....funny content! </html>"); doc.close(); } </script> <input type="button" value="insert" onclick="writeDoc()"> --- Tested in IE 6, Mozilla FB and Opera 7. Mozilla is the one that requires the name attribute on the iframe in order to access it through the frames collection. /L -- Lasse Reichstein Nielsen - lr*@hotpop DHTML Death Colors:<URL:www.infimum.dk/HTML/rasterTriangleDOM.html> ''Faith without judgement merely degrades the spirit divine.''
"gsb" <gs*@QWest> writes: Please don''t top post. Does that work with an object, or just an iFrame?Probably only with iframes. It accesses the document object of the embedded page throught the frames collection. I don''t have much experience with objects, but my impression is that pages embedded with the object tag are not easily accessible through scripting - because the object can hold so many different types of data, there is no simple way to access the data that is there. /L -- Lasse Reichstein Nielsen - lr*@hotpop DHTML Death Colors: <URL:www.infimum.dk/HTML/rasterTriangleDOM.html> ''Faith without judgement merely degrades the spirit divine.''
更多推荐
通过JavaScript编写HTML页面的Object标签?
发布评论