Open a new window

0

I know that to open a link in html is used, <a href="algo..">link</a> and to open another page we use <a href="algo.." target="_blank">link</a> but I do not know how I can do it so that when I click on the link it shows me what I need but in an external sale of the browser ... I hope you have made me understand and I would appreciate your collaboration with your knowledge.


This is a simple example of what I'm trying to do ... here when I click on the button, the result of the interview shows me that window.
This is my code.

$("#ver").click(function(event) {
    var id = 40;
    window.open('../../load_students/' + id, '_blank');

});
    
asked by JDavid 30.01.2017 в 22:12
source

2 answers

3

Only with HTML I think it is not possible to do it, but if you can approach what you are looking for with a bit of Javascript, here I leave it.

<a href="javascript:window.open('https://www.google.es','','toolbar=yes');void 0">Nueva Instancia</a>
    
answered by 30.01.2017 / 22:40
source
2

HTML

<a href="javascript: abrirNuevaVentana('parametrosSiEsQueLosNecesitas')" >
   Click para nueva ventana 
</a>

JavaScript

function abrirNuevaVentana(parametros) {
        var url = 'http://midominio.com/consultar?';
        url += 'variable=' + parametros;

        var nuevaVentana = (window.open(url, 'TituloParaLaNuevaVentana'));
        if (nuevaVentana ) {
            nuevaVentana .focus();
        }
    }

Reference: link

The MDN will be your new bible if you decide to learn web development, here is another link so you can expand: link

    
answered by 30.01.2017 в 22:20