在iframe上加载本地html

CSh*_*ner 6 html javascript iframe

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

我想test.html在客户端机器上显示iframe内部,我该怎么做?

我尝试了什么:

<iframe id="serviceFrameSend" src="file:///c:\test\test.html" width="1000" height="1000"  frameborder="0">
Run Code Online (Sandbox Code Playgroud)

但是它test.html在客户端机器上找到了该文件,那么如何才能test.html从服务器上加载它?

如果不可能,我怎么能以另一种方式做到这一点?

Dom*_*une 7

当你在服务器上有页面时,你需要使用以下一些例子:

<iframe id="serviceFrameSend" src="test.html" width="1000" height="1000"  frameborder="0">
<iframe id="serviceFrameSend" src="./test.html" width="1000" height="1000"  frameborder="0">
Run Code Online (Sandbox Code Playgroud)

如果http://它与主页位于同一目录中,则需要使用它.

<iframe id="serviceFrameSend" src="../test.html" width="1000" height="1000"  frameborder="0">
Run Code Online (Sandbox Code Playgroud)

如果file:///它位于主页的上一个目录中,则需要使用它.test.htmltest.html.

<iframe id="serviceFrameSend" src="../test/test.html" width="1000" height="1000"  frameborder="0">
Run Code Online (Sandbox Code Playgroud)

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