-1
Hello, I’m trying to open an external site through a page I created by clicking with a button, but I can not reference the document I created, follow the code below, tried several times and could not, any help is valid, thank you very much.
<!DOCTYPE html>
<head>
<title>Principal</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script src="\\fswcorp\ceic\ssoa\gaacc\System\JQuery\jquery-3.2.1.min.js"></script>
<script src="\\fswcorp\ceic\ssoa\gaacc\System\jQueryMask\dist\jquery.mask.min.js"></script>
<script src="\\fswcorp\ceic\ssoa\gaacc\System\jQueryUI\jquery-ui.js"></script>
<script>
$(document).ready(function(){
$("#dateBegin").mask('00/00/0000');
$("#dateEnd").mask('00/00/0000');
$("#buttonDownloadBRScan").click(function(){
$windowopen = window.open();
$windowopen.location.href = "https://www.fdibr.com.br/autenticacao/autenticacao/login";
$test = $windowopen.document.getElementById("usuario").innerHTML = "7478704";
})
});
</script>
</head>
<body>
<div class="dataInput">
<label id="labelDateBegin">Data Inicial</label>
<input id="dateBegin" type="date"/>
<label id="labelDateEnd">Data Final</label>
<input id="dateEnd" type="date"/>
</div>
<br><br>
<button id="buttonDownload">Download</button>
<button id="buttonDownloadBRScan">Download BRScan</button>
</body>
document.getElementById("usuario").innerHTML
- I don’t see any tag with idusuario
in html– Isac
you have control over the page that is being opened in window.open and it is of the same domain? If not, you can forget about it.
– Sam
this html that is on my page, I am automating the process of loading another page and automatically fill the user id of the other page that is an external link. but I am not able to manipulate the element of the other page through my javascript.
– Felipe Dias de Souza
@Felipediasdesouza, it would not be the case to store this value in a cookie?
– Leandro Angelo
the problem is not storing the variable but getting control of $windowopen, since it dies when the click() ends, and after the click() end I cannot work with this variable again because its scope is over.
– Felipe Dias de Souza