0

I would like to open a html file, but in a way that the browser will act as if I browsed to that page from a specific site.That is, it should expand partial addresses with regards to this site, not my local file system.For example, <img src=image/example.jpg> should look for the image in http://examplesite.com/image/example.jpg and NOT in the current path.Any POST commands should be forwarded to the real server, etc. I would like to do that, so that I will be able to download a simple webpage, edit it, and run it with the changes I made. Any ideas?

4

1 回答 1

1

您应该包含一个基本标签。这将有效地告诉浏览器从哪里开始寻找参考:

<head>
    <base href="http://examplesite.com/">
</head>

base-tag 需要 href-attribute,只能有一个并且必须在 head-tag 内

查看此链接了解更多信息:http ://www.w3schools.com/tags/tag_base.asp

于 2013-04-21T13:33:33.617 回答