EDIT: Post has been solved - see post #4 for the solution. Leaving this up here in case someone else has an error 859 in future with their LC browser! GL everyone!
So, a little while ago I got started on making an app to help with sudokus, and after a few setbacks, decided to put it on the shelf for a bit. Well, with everything that's happening I decided to take it off the shelf and give it a another shot - hopefully while being more successful than last time!
Basically, I have some JS code that can solve a sudoku very quickly, and I got it all working in JS as far as I can tell (I don't actually know much JS, so I've just been working my way through it trying to get it to work, but when I made it into an .html file and ran it in my browser, it did what it was supposed to). Unfortunately when I then go to get LC to communicate with the code I have, I get an error (see picture below).
I thought I was doing something wrong, so decided to start a new stack with the absolute basics of what I thought was needed to make LC and JS communicate just as a proof of concept. I have a field "HTMLText", which lets me paste in HTMLText to use in the browser, and widget "Browser" (very original name, I know!), a button "Button", and a field "Output" to get the output printed in there. Here's my code:
In my "HTMLText" field, I have this:
Code: Select all
<html><head><script type="text/javascript">
function solve(a)
{
var b=5;
var c;
c=a+b;
livecode.Test(c);
}
</script></head></html>
My Button code is as follows:
Code: Select all
on mouseup
put "" into field "Output"
set the HTMLText of widget "Browser" to field "HTMLText"
do "solve(5);" in widget "Browser"
end mouseup
Code: Select all
on Test c
put c into field "Output"
end Test
When I run it, I expect it to come back with 10 in the output field, but I get the error below.
Annoyingly enough, I've had this error before last time I was working on the app, and while I can't remember exactly how I fixed it, I think I changed LC versions and it worked. However that isn't working that time around, so not sure if there's something else I'm missing with it. For reference, I have LC Indy 9.6, LC Community 9.6 dp2 and LC Community 9.5.1. I'm also using a new laptop with Windows 10 on it.
If anyone knows this error or how to fix it, I would appreciate it greatly! I'd like to think that once it's fixed I'll be very close to finishing my app, but you know how programming is - once this gets fixed, there'll probably be another 37 issues I'll need to fix up before I can even find the next lot of bugs in it!
If you guys need any more info or for me to test anything, just let me know!
Many thanks!