简体   繁体   English

相对链接不在HTML页面上工作

[英]Relative Links Not working on HTML page

There is an issue I am facing in HTML page. 我在HTML页面中遇到了一个问题。

I have included a javascript code in that page due to which ActiveX warning message is thrown each time the HTML page is uploaded on local system. 我在该页面中包含了一个javascript代码,因为每次在本地系统上传HTML页面时都会抛出ActiveX警告消息。

To stop this warning being shown to the users, I have used MOTW (Mark of the Web) and included this code snippet at the top of the HTML Page: 为了阻止向用户显示此警告,我使用了MOTW(Web的标记),并将此代码段包含在HTML页面的顶部:

<!-- saved from url=(0016)http://localhost-->

This line of code prohibits the warning prompt message. 此行代码禁止显示警告提示消息。

But now the relative URLs on the page have stopped working. 但现在页面上的相对URL已停止工作。

Please help me find me a solution so that neither the ActiveX warning arises nor the relative links on the page should stop working. 请帮我找到一个解决方案,这样既不会出现ActiveX警告,也不会停止页面上的相关链接。

Thanks in advance. 提前致谢。

The ActiveX warnings should only arise when you are accessing your site from the local file system, for security reasons. 只有在出于安全原因从本地文件系统访问站点时,才会出现ActiveX警告。 When you access it through a (local or remote) web server the warnings should be gone. 当您通过(本地或远程)Web服务器访问它时,警告应该消失。

Can you not use Apache (included in XAMPP ), or something similar, to serve your pages (even locally, through http://localhost/ )? 您是否可以使用Apache(包含在XAMPP中 )或类似的东西来为您的页面提供服务(甚至在本地,通过http://localhost/ )?

Edit: 编辑:

Alternatively, you could disable that particular security setting in Internet Explorer (which I assume you use, because you mention ActiveX). 或者,您可以在Internet Explorer中禁用该特定安全设置(我假设您使用,因为您提到了ActiveX)。 Or you could try a different browser: Firefox, for example, does not have these restrictions. 或者您可以尝试不同的浏览器:例如,Firefox没有这些限制。

您是否尝试过使用<base href="ENETERBASEURLHERE" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM