Click and pass url to php using ajax?

0

How do I get the link by clicking?

Example: I have an iframe with a link that points to a page, I want to get that link, and pass via ajax pro php.

    
asked by anonymous 27.05.2017 / 08:07

1 answer

0
            <!DOCTYPE html>
            <html>
            <head>
                <title></title>
                <script  src="https://code.jquery.com/jquery-2.2.4.min.js"integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
                          crossorigin="anonymous"></script>
            </head>
            <body>
                 <iframe id="xframe" src="https://www.w3schools.com"></iframe><script>$(document).ready(function(){varaqui=$("#xframe").attr("src");//Pegando o link do Iframe
                            /*RELALIZANDO O AJAX COM O METODO POST*/

                            $.post("/meulink.com.br", {"endereco": aqui}, function(data)
                            {
                                alert(data);

                            });

                        });


                 </script>

            </body>
            </html>
    
27.05.2017 / 14:26