我有一个 PHP 代码,其中显示加载图标,然后重定向到 URL 可以说
loadingIcon = "/src/images/load.png"
位置=“default.html”;
问题是,它在页面上不断显示加载图标,并且不会继续进行 default.html 重定向。
但是如果我将位置替换为其他位置 位置 =“google.com”
它将显示加载图标,然后完美地转到 google.com。
这基本上表明问题出在default.html页面中,但我尝试在本地打开该页面,并且它工作正常。
造成这种情况的可能原因是什么?
请推荐 预先感谢您
最佳答案
替换
location = "default.html";
与
location = "yourdomain.com/pathtofile/default.html";
或
location = "../../default.html";
注意:“../../”应该是文件的精确相对路径。
关于javascript - PHP - URL 重定向奇怪的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39636761/