【问题标题】:How do I redirect to current page in laravel如何在laravel中重定向到当前页面
【发布时间】:2013-09-08 17:13:14
【问题描述】:

我正在使用 laravel 3。我有一个操作按钮,它将打开一个弹出模式。

我有一个设备列表。对于第一页,弹出模式在那里。但是对于第二页,弹出模式没有出现,而是重定向回第一页。

index.blade.php 代码:

{{ HTML::link("devices#openProfile", "Impose Profile", array("id"=>$deviceid,"class"=>"btnSkyBlue","onclick"=>"openImposeProfile($device ->id)")) }}

JS:

函数 openImposeProfile(id) {
document.getElementById("openProfile").style.display="block";
var intentedId = document.getElementById("devId_profile");
intentedId.value = id;
console.log("dev id: "+id+" | 预期:"+intentedId.value);
}

【问题讨论】:

    标签: javascript laravel laravel-3


    【解决方案1】:

    这就是你在 L4 中的做法

    <a href="{{ URL::to('devices') }}#openProfile" id="{{ $deviceid }}" class="btnSkyBlue" onclick="openImposeProfile('{{ $device->id }}')">Impose Profile</a>
    

    URL::to 在 L3 中可能不同

    提示:你应该学习 jQuery :) 它会让你的生活更轻松

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-10
      • 2013-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多