function from onclick in external url iframe

1

How to get the parameters of an onclick being the link in an external url iframe? on the same server does exactly what I need, already working with the help of a Stack (dvd) user.

function looks like this:

         function funcao1(dom,seg,par){
        var converter = atob(par); // decodifica base64
        var decodif_url = decodeURIComponent(converter); // decodifica uri
        var parx = JSON.parse(decodif_url); 
        var parx = parx.nome; 
        var parx = btoa(parx); // recolocar apenas nome em base64 para URL
        var url_ = "http://www."+dom.toLowerCase()+".com/pesquisa.php?"+parx+"&segmento="+par;
        window.open(url_,"_blank"); // abre em nova guia
        }

link in the iframe EXTERNAL url looks like this:

        <a href="#" onclick="javascript:parent.funcao1('TESTE','ABCD', 'JTdCJTIybm9tZSUyMiUzQSUyMmpvYW8lMjIlMkMlMjJpZGFkZSUyMiUzQSUyMjM3JTIyJTdE');">
                          <nobr>TESTE</nobr>
                       </a>
    
asked by anonymous 21.04.2018 / 16:25

0 answers