SOLVED: Set database's .pdf url to open in new tab insted of download from a repeater

I disconnected the repeater’s button from the dataset url field and added the code below. Now, when I click it does open the url in a new tab, however it is not displaying the content. It shows a blank page with a ‘Forbbiden’ warning on the left top. Any further help please?

$w.onReady(function () {
    $w("#repeater1").onItemReady(($item, itemData, index) => {
 
    $item('#button2').link = itemData['link'];
    $item('#button2').target = '_blank';

})});