Posts: 771
Threads: 223
Joined: Sep 2017
Reputation:
0
07-18-2020, 02:50 PM
(This post was last modified: 07-18-2020, 02:51 PM by richb201.)
Thanks. In the controller. Does that code go directly in the controller?
proof that an old dog can learn new tricks
Posts: 9
Threads: 3
Joined: Jul 2020
Reputation:
0
I was wrong regarding that you should use a function to execute this line
window.open('https://duckduckgo.com/?t=ffab', '_blank');
i tried it directly in the controller and it worked
<?php namespace App\Controllers;
use CodeIgniter\Controller;
class Controller1 extends Controller
{
public function index()
{
echo "
<script>
window.open('https://duckduckgo.com/?t=ffab', '_blank');
</script>
";
}
}
but firefox told me that its preventing popups , so i enabled them for localhost , maybe you are disabling them.
Posts: 771
Threads: 223
Joined: Sep 2017
Reputation:
0
07-30-2020, 07:13 AM
(This post was last modified: 07-30-2020, 08:03 AM by richb201.)
thx. That worked. One thing, I'd like to open Google Patents in a new tab. How can I change that?
I tried this mod
<button class="btn btn-primary btn-lg" onclick="location.href='https://patents.google.com/','_blank'">Open Google Patents</button>
but it still opens in the same tab
proof that an old dog can learn new tricks
Posts: 771
Threads: 223
Joined: Sep 2017
Reputation:
0
I am getting the same thing:
<div style=”float:left”>
<button class="btn btn-primary btn-lg" onclick="location.href='https://patents.google.com/',target='_blank'">Open Google Patents</button>
</div>
proof that an old dog can learn new tricks