altagur Posted November 25, 2013 Posted November 25, 2013 Please ask me how do anything after main form show. I want to play music such in example "HTML5 Audio" and write on UniFormShow UniSession.SendResponse('audio2.load(); audio2.play();'); it raize error I am attempt write in Client Evet afterrender audio2.load(); audio2.play(); not work on Ajax procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);begin if EventName='afterrender' then begin UniSession.SendResponse('audio2.load(); audio2.play();'); end;end; not work Use TUniTimer procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings);begin if EventName='afterrender' then begin UniTimer1.Enabled := True; end;end; and procedure TMainForm.UniTimer1EventHandler(Sender: TComponent; EventName: string; Params: TStrings);begin UniSession.SendResponse('var ael=document.getElementById("audio2");ael.load();ael.play()');end; Timer event not fiered Is exist event fiered after form already show rendered ad? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.