1
How to receive the parameters of an onclick when the link is in an external url iframe? on the same server does exactly what I need, already working with the help of a Stack user (dvd).
function this way:
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 EXTERNAL url iframe like this:
<a href="#" onclick="javascript:parent.funcao1('TESTE','ABCD', 'JTdCJTIybm9tZSUyMiUzQSUyMmpvYW8lMjIlMkMlMjJpZGFkZSUyMiUzQSUyMjM3JTIyJTdE');">
<nobr>TESTE</nobr>
</a>
Did you take the test? It didn’t work?
– Sam
worked perfectly, this new question was to find out if there is a way to circumvent the access restriction to run this javascript in iframes with another domain url (external url).
– user9618369
Ah tah rs çuçréu!
– Sam
In this case if it is an external server, you would have to include the function there and set something that allows CORS.
– Sam