nikoli/views/sudoku.slim

18 lines
486 B
Plaintext

- content_for(:title) { 'Sudoku' }
h1 Sudoku
#board
script type="text/javascript" src="/sudoku.js"
javascript:
document.addEventListener("DOMContentLoaded", function() {
sudoku = new Sudoku(document.getElementById('board'));
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "#{url('/data/sudoku/gnome-sudoku_easy.json')}");
xmlhttp.addEventListener('load', function(evt) {
sudoku.generate(JSON.parse(evt.target.responseText)) })
xmlhttp.send();
});