0

i have this function but when I add in the html target = '_ blank' it doesn't open in a new tab

enter code here
function openSection(evt,sectionName) {
  evt.preventDefault();
var url = ''+sectionName+'.php';
console.log(url);
$('#content-nav-wilflix li').removeClass('active');
$('#btn-view-'+sectionName+'').parent('li').addClass('active');
$.ajax({
    url:url,
    beforeSend:function(){
        $('.content-categorias').html('cargando...');
    },success:function(){
        $('.content-categorias').load(url);
    }
});
  • 1
    You aren't showing any html. Without providing a [mcve] that demonstrates the issue, it is hard for anyone to help troubleshoot this without guessing – charlietfl Dec 06 '20 at 00:40
  • in addition, `$.ajax(url)` and `$(...).load(url)` will make the exact same request for the same content. The result is different, but why make the same request as a result of a previous request that is exactly the same? – Randy Casburn Dec 06 '20 at 00:43
  • in the html when you click the same page it loads to another url but what I'm looking for is to load it in another tab – Absolute Dec 06 '20 at 00:44
  • Does [this](https://stackoverflow.com/questions/19851782/how-to-open-a-url-in-a-new-tab-using-javascript-or-jquery) help? – costaparas Dec 06 '20 at 01:11

0 Answers0