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>