I am trying to cycle through all of the Zodiac signs using Javascript/Jquery.
Is there a way to do this by just counting up and then displaying that Character?
At first I tried this Using the &#XXXX way of writing the characters, but they would not be converted to their respective Unicode character, but instead displayed literally.
Then I tried using uXXXX but I got the Error: “malformed Unicode character escape sequence”. Here is my code:
setInterval(changeZodiac, 200);
var whichZodiac = 9800;
function changeZodiac() {
var hexZodiac = whichZodiac.toString(16);
console.log(hexZodiac);
> $("#zodiac").text("u" + hexZodiac);
whichZodiac++;
if (whichZodiac > 9811) {
whichZodiac = 9800;
> }
> }
The error feels like it is there to prevent a problem if something like this happens accidentally. But is there a way to make this work intentionally?
Jaron is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.