Javascript 如何重定向到laravel中的当前页面

Javascript 如何重定向到laravel中的当前页面,javascript,laravel,laravel-3,Javascript,Laravel,Laravel 3,我和拉威尔3一起工作。我有一个动作按钮,将打开一个弹出模式 我有一个设备清单。对于第一页,弹出模式就在那里。但对于第二页,弹出模式不会出现,但会重定向回第一页 index.blade.php代码: {{HTML::link(“设备#openProfile”,“强制配置文件”,数组(“id”=>$deviceid,“class”=>“btnSkyBlue”,“onclick”=>“openImposeProfile($device->id)”)} JS: 函数openImposeProfile(i

我和拉威尔3一起工作。我有一个动作按钮,将打开一个弹出模式

我有一个设备清单。对于第一页,弹出模式就在那里。但对于第二页,弹出模式不会出现,但会重定向回第一页

index.blade.php代码:

{{HTML::link(“设备#openProfile”,“强制配置文件”,数组(“id”=>$deviceid,“class”=>“btnSkyBlue”,“onclick”=>“openImposeProfile($device->id)”)}

JS:

函数openImposeProfile(id){
document.getElementById(“openProfile”).style.display=“block”
var intentedId=document.getElementById(“设备配置文件”);
intentendId.value=id;
console.log(“开发id:+id+”|预期:+intentendID.value);
}


这就是你在L4中的做法

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

URL::to在L3中可能不同

提示:您应该学习jQuery:)它将使您的生活更轻松