From: constraintAutomaton Date: Tue, 8 Apr 2025 18:13:02 +0000 (+0200) Subject: Fix DOM manipulation to avoid deprecated functions in Sudoku solver example. X-Git-Tag: v0.10.0~55^2~2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=024c498beeb7d49dd65babbcb498abee03346c19;p=scryer-prolog.git Fix DOM manipulation to avoid deprecated functions in Sudoku solver example. --- diff --git a/README.md b/README.md index 2cd8be48..68a4cec8 100644 --- a/README.md +++ b/README.md @@ -266,17 +266,24 @@ Then a `pkg` directory will be created, containing everything you need for a web } // Output results - document.write(`

Sudoku solver returns:

`); + const solutionDiv = document.querySelector("#soduku-solution"); for (const solution of formattedSolutions) { - document.write(`
${solution}
`); + const newPre = document.createElement("pre"); + newPre.textContent = solution; + solutionDiv.appendChild(newPre); } - - + +

Sudoku solver returns:

+
+ +
+ + ``` Then you can serve it with your favorite http server like `python -m http.server` or `npx serve`, and access the page with your browser.