I am trying to call the method in javascript through ruby
Ruby code:
d = UI::HtmlDialog.new()
d.set_file(File.join(File.dirname(__FILE__), '../html/test.html'))
d.add_action_callback("test") do |wd, p|
puts "Test Successful"
end
d.show {
puts "Show the dialog"
d.execute_script('test(1);')
}
Html Code
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="./../css/style.css" type="text/css" />
<title>Test</title>
</head>
<body>
<fieldset>
<legend>Scale</legend>
<div id="slidecontainer">
<input type="range" min="0.01" max="100" value="1" class="slider" id="scale_slider" step="0.01">
</div>
<input id="scale_input" onfocus="select_text(this.id);" size="7" value="0"/>
</fieldset>
<script>
function test(value) {
var slide_amount = document.getElementById("scale_input");
slide_amount = value;
window.location='skp:test@' + value;
}
</script>
</body>
</html>
I can see the dialog with slider and input field. But “test” method is not getting executed.
What am I missing here ?