How to execute/run modal window on load page? - flow theme

I mean how to do this with flow template and tried to find some… good oxid practice for this :slight_smile:

For now i made:
[{oxscript add="$(document).ready(function(){
$(’#popupbutton’).trigger(‘click’);
})"}]
with if() conitional it works ok but i’m not proud of it hehehe