Get Content from another page with jquery

1

I want to create a way to open this SpTrans page in an app, but without loading all their layout, just the fields: LOGIN, PASSWORD and SIGN UP, using only HTML and JQUERY.

The elements I need are these:

<input type="text" id="vUSRLOGA" name="vUSRLOGA" value="" size="20" maxlength="20" class="Atributo_LOV" style=";height: 1row;text-align:left" onfocus="gx.evt.onfocus(this, 21,'',false,'',0)" onchange="gx.evt.onchange(this)" onblur="this.value=this.value.toUpperCase();;gx.evt.onblur(21);">

<input type="password" id="vUSRSEN" name="vUSRSEN" value="" maxlength="32" class="Atributo_LOV" style=";width: 128px;;height: 1row;text-align:left" onfocus="gx.evt.onfocus(this, 23,'',false,'',0)" onchange="gx.evt.onchange(this)" onblur="this.value=this.value.toUpperCase();;gx.evt.onblur(23);">

<input type="image" src="Resources/cadastrese.gif" name="BTCADASTRO1" onclick="if( gx.evt.jsEvent(this)) {gx.evt.execEvt('E\'CADASTRO\'.',this);return false;} else return false;" id="BTCADASTRO1" title="Efetuar Novo Cadastro" class="Image" onfocus="gx.evt.onfocus(this, 47,'',false,'',0)">

I've tried it this way, searching for the element ID

$.ajax({
    url: 'http://www.sptrans.com.br/sac/solicitacoes.aspx',
    type: 'GET',
    success: function(res) {
        var headline = $(res.responseText).find('vUSRLOGA'); 
        $("#conteudo").html(headline);
    }
}); 

and so searching the whole page.

$.ajax({
            url: 'http://www.sptrans.com.br/sac/solicitacoes.aspx',
            type: 'GET',
            success: function(res) {
                var headline = $(res.responseText).text();
                $("#conteudo").html(headline);
            }
        })

but in none of them do you have the fields, only the texts on the page.

What I want to do is store the site in a variable and present it to the user, just the login fields, password and sign up.

But I do not know how to do this, does anyone know? without using other languages, just Jquery.

<!DOCTYPE HTML>
<html lang="pt-br">

<head>
<!-- Scripts Javascript -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><scripttype="text/javascript" src="http://projetos.lucaspeperaio.com.br/ajax-cross-domain/jquery.xdomainajax.js"></script><scripttype="text/javascript">
/*$.ajax({
            url: 'http://www.sptrans.com.br/sac/solicitacoes.aspx',
            type: 'GET',
            success: function(res) {
                var headline = $(res.responseText).text();
                $("#conteudo").html(headline);
            }
        });*/

        $.ajax({
    url: 'http://www.sptrans.com.br/sac/solicitacoes.aspx',
    type: 'GET',
    success: function(res) {
        var headline = $(res.responseText).find('vUSRLOGA'); 
        $("#conteudo").html(headline);
    }
}); 

</script>


<title>Teste</title>
<body>




    <div id="conteudo" style="background:#EEF0A6"></div>


</body>
</html>

    
asked by anonymous 16.07.2015 / 17:22

1 answer

1

I do not know if this is the case, but I have an IFRAME that has this same idea:

As below, I have a screen that is from another site, I used the iframe that opens the site in the link portal of knowledge , then there inside everything is the domain of the other site

Belowtheofficialwebsite

Follow sample source code:

<style>
    #fieldsetFazenda {
        display: none;
        left: 1360px;
        position: relative;
        top: -679px;
        width: 500px;
    }
    #chave {
        background: #eeeeee none repeat scroll 0 0;
        font: bold 15pt Arial;
        height: 240px;
        position: absolute;
        text-align: center;
        width: 770px;
    }
    #div-fazenda {
        overflow: hidden;
    }
    
#fazenda {
    border: 1px none;
    height: 1360px;
    margin-top: 10px;
    overflow: hidden;
    width: 768px;
}
</style>
        <legend class="ui-widget ui-widget-header ui-corner-all">Conhecimento Eletronico</legend>          
        <div id="chave">
            <p id="palavra-chave">Chave de Acesso para a consulta:</p>
            <strong id="chaveAcesso" class="auto">0000000000000000000000000000000000</strong>
        </div>
        <div id="div-fazenda">
            <iframe id="fazenda" src="http://www.cte.fazenda.gov.br/consulta.aspx?tipoConsulta=completa&amp;tipoConteudo=mCK/KoCqru0="></iframe>    
        </div> 
    
16.07.2015 / 23:04