At the moment I'm making Sudoku app, and I found a handy bit of javascript that I'm going to use to solve the sudoku. The problem though is that when I try it out on my computer, it works flawlessly. No issues, nothing. However, when I deploy it to my phone, it doesn't work. It's as if the Javascript code isn't even being run, which is weird, as I've put a few things in the callback from JS to let me know it work (things like setting the text of a field to something specific, which works on computer but not Android). This is the code I've got here:
Code: Select all
on openStack
set the javascriptHandlers of widget "browser" to "JSresult"
set the htmltext of widget "browser" to field "HTML"
wait 1 ticks with messages
end openStack
Code: Select all
on SolveJS
local sudoku4JS, r
put "[" into sudoku4JS
repeat with i = 1 to 9
put "[" into r
repeat with j = 1 to 9
put TestCellTracker[i][j] & comma after r
end repeat
put "]" into char -1 of r
put r & comma after sudoku4JS
end repeat
put "]" into char -1 of sudoku4JS
-- call solve_sudoku Javascript function
-- ends up by calling livecode handler: JSresult
-- answer exists(widget "Browser")
-- answer the javascriptHandlers of widget "browser"
-- answer the htmlText of widgetBrowser
do "var g=" & sudoku4JS & ";var r=solve_sudoku(g);" in widget "Browser"
end SolveJS
Code: Select all
command JSresult gridR
put gridR[1][1] &": "& word 5 of the internet date into fld "TestLabel"
DrawSolution gridR
end JSresult
If you guys have any advice on how I can fix this, that would be appreciated!