I’ve code below:
<!DOCTYPE html>
<meta charset="UTF-8">
<title>An HTML5 document</title>
<script>
document.write('\45');
</script>
The result is that I get a ‘%’. Why? I can’t understand the code.
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The character
%has the ASCII value 37.\45is an octal escape code for character 37 (because 4 * 8 + 5 = 37).Note that according to the Mozilla Developer Network the usage of octal escape codes in string literals is deprecated: