我需要找到基本网址并将其重定向到“主页”页面。另外我需要使用相对表达式,这样我就不必编辑 js 文件,它可以在不同的网站中使用。
我正在使用 jquery,到目前为止我有这个:
if (location.host) { location.replace((location.host) + '/home'); }
但不起作用......我是 js 的新手,我需要帮助。
javascript redirect
javascript ×1
redirect ×1