在iframe上加载本地html [英] Load local html on iframe

查看:2651
本文介绍了在iframe上加载本地html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器 .html 页面位于 c:\ test\test.html

I have in my server .html page located on c:\test\test.html.

我想在客户端计算机上的iframe中显示 test.html ,我该怎么做?

I want to display test.html inside iframe on the client machine, how can I do that?

我尝试过:

<iframe id="serviceFrameSend" src="file:///c:\test\test.html" width="1000" height="1000"  frameborder="0">

但它找到了 test.html 文件在客户端计算机上,如何才能从服务器加载 test.html

But it's found the test.html file on the client machine, so how can I make that the test.html will be loaded from the server?

如果不可能,我怎么能用另一种方式呢?

If it isn't possible, how can I do that in another way?

推荐答案

当你在服务器上有页面时需要使用其中一些示例:

As you have the page on the server you need to use some of these examples:

<iframe id="serviceFrameSend" src="test.html" width="1000" height="1000"  frameborder="0">
<iframe id="serviceFrameSend" src="./test.html" width="1000" height="1000"  frameborder="0">

如果 test.html 与您的主页位于同一目录中。

You need to use this, if the test.html is in the same directory as your main-page.

<iframe id="serviceFrameSend" src="../test.html" width="1000" height="1000"  frameborder="0">

如果 test.html 位于主页的上一个目录中。 path / views / test / test.html path / views / main / page.html

You need to use this, if the test.html is in the previous directory of your main-page. path/views/test/test.html and path/views/main/page.html.

<iframe id="serviceFrameSend" src="www.server.com/test/test.html" width="1000" height="1000"  frameborder="0">

如果你知道打开测试的网址,你需要使用它.html

这篇关于在iframe上加载本地html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆