1
I want to create a way to open this page of Sptrans in an app, but without loading all their layout, only the fields: LOGIN, PASSWORD and REGISTER, 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 thus searching the entire 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 brings the fields, only the texts of the page.
What I want would be to store the site in a variable and present to the user, only the login fields, password and register.
But I don’t know how to do it, does anyone know? without using other languages, only 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>
<script type="text/javascript" src="http://projetos.lucaspeperaio.com.br/ajax-cross-domain/jquery.xdomainajax.js"></script>
<script type="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>
An Iframe would solve ?
– SneepS NinjA