I have to execute a script on load of an Spotfire analisys. I used this method:
JScript:
$(function () {
function executeScript() {
$('#hiddenBtn input').click();
}
$(document).ready(function(){executeScript()});
});
HTML:
<Span style="display:none" id="hiddenBtn">
<SpotfireControl id="f8322a6109af43fb935ad6e7bcb1f1fc" /></span>
if Document.Properties["OpenedYet"] == False:
Document.Properties["OpenedYet"] = True
## Script you are trying to run on open here
BUT
the event $(document).ready() FIRE continuously and script was executed continuously. I tried with $(document).load() or $(window).load() but the event was never fired. There is a way to execute a script ONCE on load?
Actually it might be better to use a hidden input field in order to change the document property and thus to trigger the python script.
Have a look here...
and also here