[英]How do I redirect to current page in laravel
I am working with laravel 3. I have an action button which will open a popup modal. 我正在使用laravel3。我有一个操作按钮,它将打开一个弹出模式。
I have a list of devices. 我有设备清单。 for first page, the popup modal was there.
对于第一页,弹出模式在那里。 But for second page, the popup modal not coming out but it redirect back to the first page.
但是对于第二页,弹出模式不会出现,但会重定向回第一页。
index.blade.php code: index.blade.php代码:
{{ HTML::link("devices#openProfile", "Impose Profile", array("id"=>$deviceid,"class"=>"btnSkyBlue","onclick"=>"openImposeProfile($device->id)")) }}
{{HTML :: link(“ devices#openProfile”,“ Impose Profile”,array(“ id” => $ deviceid,“ class” =>“ btnSkyBlue”,“ onclick” =>“ openImposeProfile($ device-> id )“))}}
JS: JS:
function openImposeProfile(id) {
函数openImposeProfile(id){
document.getElementById("openProfile").style.display="block";document.getElementById(“ openProfile”)。style.display =“ block”;
var intentedId = document.getElementById("devId_profile");var intentedId = document.getElementById(“ devId_profile”);
intentedId.value = id;intentedId.value = id;
console.log("dev id: "+id+" | intended: "+intentedId.value);console.log(“ dev id:” + id +“ |意图:” + intentedId.value);
}}
This is how you would do it in L4 这就是您在L4中的做法
<a href="{{ URL::to('devices') }}#openProfile" id="{{ $deviceid }}" class="btnSkyBlue" onclick="openImposeProfile('{{ $device->id }}')">Impose Profile</a>
URL::to might be different in L3 URL :: to在L3中可能有所不同
Tip: you should learn jQuery :) it will make your life easier 提示:您应该学习jQuery :)它将使您的生活更轻松
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.