Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript header and location.href赢得´;不要加载另一个页面,而是使用根目录_Javascript_Php - Fatal编程技术网

Javascript header and location.href赢得´;不要加载另一个页面,而是使用根目录

Javascript header and location.href赢得´;不要加载另一个页面,而是使用根目录,javascript,php,Javascript,Php,我尝试在我的php网站上包含一些重定向到我的github的按钮,但它们不是重定向到我的github,而是尝试在myd目录中查找链接。因此,我没有获得github.com,而是获得localhost/projects/index.php/github.com尝试而不是对于按钮,您可以应用以下html,您必须包含HTTPS协议,否则它将被解释为本地文档 <button onclick="window.location.href='https://github.com/'">Github&

我尝试在我的php网站上包含一些重定向到我的github的按钮,但它们不是重定向到我的github,而是尝试在myd目录中查找链接。因此,我没有获得github.com,而是获得localhost/projects/index.php/github.com

尝试
而不是
对于按钮,您可以应用以下html,您必须包含HTTPS协议,否则它将被解释为本地文档

<button onclick="window.location.href='https://github.com/'">Github</button>
Github

可能忘了在url中包含协议部分。提供相关代码。如果没有它,我们只能猜测出哪里出了问题。我建议您在答案中添加一些解释性文字,否则您可能会将其删除为“低质量”(即使它可能是正确的答案)!