Hi all,
I want to run the following script in my page, but it crashes because kobo sees the "<" sign as the start of a tag (i think)
Quote:
<script type="text/javascript">
function updateTimeText() {
const now = new Date();
const hour = now.getHours();
let greeting;
if (hour < 12) {
greeting = "Good morning!";
} else if (hour < 18) {
greeting = "Good afternoon!";
} else {
greeting = "Good night!";
}
document.getElementById("weathertime").textContent = greeting + " it is now " + now.toLocaleTimeString();
}
</script>
|
It does not seem to replace the text on my page with the correct greeting and time, what am i doing wrong? Adding the //<![CDATA[ tags doesn't seem to change anything.
it does work on an ereader in my browser