Run ruby from javascript isn’t work. It’s happened when I put the code used to run Ruby inside Window.onload
The first time opening htmlDialog, the code is working properly but when I close the htmlDialog then reopen it . The code is not working.
My Javascript:
<script>
window.onload = (event) => {
sketchup.puts_string("window onload")
};
</script>
My .rb file:
$dialog.add_action_callback("puts_string") { |action_context, string|
puts string.to_s
}
How to make it work?
Thank you in advance!