The page is in aspx and html/javascript.
I’m looking for how to get the value of the data file content of the html object tag in the variable ObjText to compare via javascript and display or not the div
If the file Alerte_PageLogin1.txt content is N/A in this case the div is hidden
I tried full example on other post of the site but none works
Default.aspx
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta Http-Equiv="Cache" content="no-cache">
<meta Http-Equiv="Pragma-Control" content="no-cache">
<meta Http-Equiv="Cache-directive" Content="no-cache">
<meta Http-Equiv="Pragma-directive" Content="no-cache">
<meta Http-Equiv="Cache-Control" Content="no-cache">
<meta Http-Equiv="Pragma" Content="no-cache">
<meta Http-Equiv="Expires" Content="0">
<meta Http-Equiv="Pragma-directive: no-cache">
<meta Http-Equiv="Cache-directive: no-cache">
</head>
<body>
<div id="webLink">
<div id="DivAlertePageLogin">
<p style="background: #ffe7e8; border: 2px solid #e66465; line-height: 1.5;">Information incidents informatique majeur en cour :</p>
<br>
<marquee>
<object id="ObjAlertePageLogin" width="300" height="100" type="text/plain" data="test.txt" border="0" style="overflow: hidden;"></object>
</marquee>
</div>
</div>
<script type="text/javascript">
var newUrl = 'Alerte_PageLogin1.txt';
var divEl = document.getElementById('DivAlertePageLogin');
var objEl = document.getElementById('ObjAlertePageLogin');
objEl.data = newUrl;
// Refresh the content
divEl.innerHTML = divEl.innerHTML;
//var content = document.getElementById('ObjAlertePageLogin').value
//var content = document.getElementById('ObjAlertePageLogin').innerText;
//alert(content);
</script>
<script type="text/javascript">
//function or code for get content file Alerte_PageLogin1.txt
var ObjText = ""; // variable content file Alerte_PageLogin1.txt
var Disable = "N/A";
if (Disable == ObjText) {
document.getElementById("DivAlertePageLogin").style.display = "block";
} else {
document.getElementById("DivAlertePageLogin").style.display = 'none';
document.getElementById("DivAlertePageLogin").style.visibility = "hidden";
}
</script>
</body>
</html>
Alerte_PageLogin1.txt
New alerte on server one
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…