网站开发中,我们经常需要使用链接跳转,比如登录成功后,自动跳转到首页等等,下面方面介绍 PHP & JS 的几种链接跳转方式

 

PHP

<?php
    header("Location: https://www.ryanzoe.top/");

 

 

JS

<script>
window.location = 'https://newurl.com'
</script>

如果想要跳转到同一个网站的不同路径下,可以使用下面的方式

<script>
window.location.pathname = '/new'
</script>

 

相关文章:

  • 2021-12-31
  • 2021-11-30
  • 2022-12-23
  • 2021-10-06
  • 2022-02-08
  • 2021-07-04
  • 2021-12-31
  • 2021-12-31
猜你喜欢
  • 2022-02-08
  • 2022-02-08
  • 2022-02-11
  • 2021-06-25
  • 2021-12-15
  • 2021-09-24
相关资源
相似解决方案