Javascript 使用modal打开新选项卡,并重定向laravel项目中的旧页面
我正在尝试在我的laravel项目中使用一个标记,用modal打开新选项卡,并将旧选项卡重定向到另一个页面 我尝试了许多解决这个问题的方法,但没有得到结果 解决办法之一是Javascript 使用modal打开新选项卡,并重定向laravel项目中的旧页面,javascript,html,laravel,Javascript,Html,Laravel,我正在尝试在我的laravel项目中使用一个标记,用modal打开新选项卡,并将旧选项卡重定向到另一个页面 我尝试了许多解决这个问题的方法,但没有得到结果 解决办法之一是 <a onclick="window.open('https://www.w3schools.com');" data-toggle="modal" data-target="#Mymodal{{$question->id}}">Open Modal</a> 我在控制器中添加了新的
<a onclick="window.open('https://www.w3schools.com');" data-toggle="modal" data-target="#Mymodal{{$question->id}}">Open Modal</a>
我在控制器中添加了新的函数,用jquery代码打开页面以加载该模式
<script>
$(window).load(function(){
$('#Mymodal{{$question->id}}').modal('show');
});
</script>
$(窗口).load(函数(){
$('Mymodal{{$question->id}}').modal('show');
});
我仍然无法重定向旧选项卡//html
//html
<a id="click" href="www.abc.com" target="_blank"></a> //link to open in new tab
//script
{
$("#click").click();
window.location.replace("http://stackoverflow.com"); // link to redirect the current tab
}
//链接以在新选项卡中打开
//剧本
{
$(“#单击”)。单击();
window.location.replace(“http://stackoverflow.com“”;//链接以重定向当前选项卡
}
//html
<a id="click" href="www.abc.com" target="_blank"></a> //link to open in new tab
//script
{
$("#click").click();
window.location.replace("http://stackoverflow.com"); // link to redirect the current tab
}