Yon*_*nic 3 html javascript url window.open
假设我的网站中有一个页面:
mywebiste.com/section1/slideshow/main/example.html我想用来window.open()访问我网站中的这些页面:
mywebsite.com/section2/index.htmlmywebsite.com/section2/article1/gallery.htmlmywebsite.com/login.php这些只是随机的示例,但我试图指出它们距离页面非常远example.html,我将不得不使用大量的../和 因此最终会得到非常长(且令人困惑)的URL。
我认为应该有一种方法可以直接访问网站的根目录,但仍然使用相对URL。(就像如果存在快捷方式.../或root/可以将您重定向到根目录)。
这可能吗?
/ 只是以一个应该工作作为序言。
window.open('/section2/index.html', ...); // etc
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2836 次 |
| 最近记录: |