假设当前网址是:www.my.com/somewhere
。href到当前网址的子目录
而且我有一个href
链接,并希望它去:www.my.com/somewhere/subpage
没有href
写入电流URL(www.my.com/somewhere
)。
它可能在纯HTML(不是通过JavaScript或服务器端的东西)?
假设当前网址是:www.my.com/somewhere
。href到当前网址的子目录
而且我有一个href
链接,并希望它去:www.my.com/somewhere/subpage
没有href
写入电流URL(www.my.com/somewhere
)。
它可能在纯HTML(不是通过JavaScript或服务器端的东西)?
除非我误解你。你应该只能写href =“/ subpage”。
你可以简单的写的相对路径在您的href,像这样: <a href='subpage'></a>
该链接转到“www.my.com/subpage”。我需要去当前网址的子文件夹。 – Deckard
你是否因为某种原因在你的html的'
'中指定了一个'
这是一个绝对的链接,以便它去'www.my.com/subpage'。我需要去“www.my.com/somewhere/subpage”。 – Deckard
如果您的当前目录是www.my.com/somewhere,并且您想要访问www.my.com/somewhere/subpage,那么我刚才的内容应该可以工作。它在我的网站上工作,我只是检查它。如果您在www.my.com目录中,那么您可以使用href =“/ somehwere/subpage” – CaliKane