you can"t get the desired string by using the text () method of jquery"s id selector;
if you try using native js, it"s the same.
code is as follows;
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body id="body" style="display: none">
%0A%3C%21--%u6B64%u7F51%u9875%u5DF2%u52A0%u5BC6%uFF0C%u6B32%u89E3%u5BC6%u8BF7%u5230code.qcgzxw.cn/html.html%u89E3%u5BC6--%3E%0A%3Cform%3E%0A%20%20%20%20%3Ctr%3E%0A%20%20%20%20%20%20%20%20%3Ctd%3Edd%3C/td%3E%0A%20%20%20%20%20%20%20%20%3Ctd%3Eff%3C/td%3E%0A%20%20%20%20%20%20%20%20%3Ctd%3Ecc%3C/td%3E%0A%20%20%20%20%3C/tr%3E%0A%3C/form%3E%0A%3C%21--%u6B64%u7F51%u9875%u5DF2%u52A0%u5BC6%uFF0C%u6B32%u89E3%u5BC6%u8BF7%u5230code.qcgzxw.cn/html.html%u89E3%u5BC6--%3E%0A
</body>
</html>
<script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script>
<script>
/**
*
* @constructor
*/
function OutWord()
{
var Words = $("-sharpbody").text();
var NewWords;
console.log(Words);
NewWords = unescape(Words);
console.log(NewWords);
$("-sharpbody").html(NewWords).css("display", "block");
}
OutWord();
</script>
Why does the $("- sharpbody"). Text ()) take something from the script tag?
/**
*
* @constructor
*/
function OutWord()
{
var Words = $("-sharpbody").text();
var NewWords;
alert(Words);
console.log(Words);
NewWords = unescape(Words);
console.log(NewWords);
$("-sharpbody").html(NewWords).css("display", "block");
}
OutWord();
what is the principle of this? I have never encountered such a situation before;
ask for help;