I have a ‘working’ WebDialog, which does what I want it to do, and is passing messages between JS and Ruby.
But it is triggering an error when using Martin Rinehart’s code to send the message from JS to Ruby.
When I make the function do nothing by removing its contents, I don’t get the error. When I leave those lines in, the code ‘works’ to send message to Ruby, but gets the EOF error (actually pointing to the end of the first line of the HTML page, which is an HTML comment).
Here’s the line that calls it, and the function:
...
sendToRuby( 'get_inputs', result );
} // End if formValid
} // End function button_clicked
// --------------------------------------------------------------------------------------
// The following three JS functions, and the Ruby callback functions get_inputs() and set_values()
// work together to pass messages back and forth between this WebDialog page's input fields and Ruby
function sendToRuby( cb_name, msg ) {
fake_url = 'skp:' + cb_name + '@' + msg;
window.location.href = fake_url;
}// End function sendToRuby
...
And it produces this error message in the console when run.
[Error] SyntaxError: Unexpected EOF
(anonymous function) (JWM_wd_InputBox.html:1)
Do I just ignore this? Or is there another way of getting JS to send to Ruby?
PS. When testing just the HTML page in Chrome, I don’t see this error. But on my iMac, the WebDialog is running the Safari WebKit, and the WebDialog is opened by Ruby.