2014-04-22 11:57
浏览 30

Laravel 4-重定向到javascript代码中的路径刀片模板

I'm trying to write a simple redirection using javascript and blade engine, and this is an example of what i want to do:

javascript code:

<p>Click the button to go to the home page</p>

<button onclick="myFunction()">Click me</button>

<p id="demo"></p>

function myFunction()
    var x;
    var r=confirm("Are you sure you want to leave this page ?");
    if (r==true)
      //Redirect to home
     //stay here

when i use return Redirect::route('home') it does not work, what is the right syntax to do that, and sorry for my bad english.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新