页面代码:

1  <p class="info"><span style="font-weight: bold">所属项目:</span>
2         @foreach($programList as $task)
3             @if($taskList->project == $task->id )
4                 <span onclick="xiangmu({{$task->id}})"   style="color: #3c8dbc;font-family: SimSun;cursor: pointer">{{$task->name}}</span>
5             @endif
6         @endforeach
7     </p>

其中,cursor: pointer,鼠标经过箭头变为小手

1 <script>
2         function xiangmu(id)
3         {
4 
5             window.open('{{url('taskDetail')}}'+'/'+id);    //跳转
6             window.history.back(-1);    //返回上一页面
7 
8         }
9     </script>

效果:js关闭当前页面跳转新页面

 

相关文章:

  • 2021-11-24
  • 2021-08-19
  • 2021-12-22
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2021-12-03
猜你喜欢
  • 2021-06-01
  • 2021-06-21
  • 2021-12-03
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案