TAURO Posted September 13, 2020 Share Posted September 13, 2020 When an form with a UniURLFrame, that load at runtime, is completely loaded and a function scripts js enabled for execute.?? When execute with a button's click the function exists but if execute at event FormReady not exist yet. This is the example In Html Code: function PonerDireccion(Direccion) { document.getElementById("geocomplete").value = Direccion; } In delphi: procedure TFAutoGeoReferencia.UniFormShow(Sender: TObject); begin UniSession.AddJS(UniURLFrame1.JSName+'.iframe.contentWindow.PonerDireccion("'+Domicilio+'"); '); end; Here the function not exists yet Here yes exists and execute, work fine!! procedure TFAutoGeoReferencia.uniBtn1Click(Sender: TObject); begin UniSession.AddJS(UniURLFrame1.JSName+'.iframe.contentWindow.PonerDireccion("26 Nro 1785"); '); end; Link to comment Share on other sites More sharing options...
Sherzod Posted September 13, 2020 Share Posted September 13, 2020 Hello, 2 hours ago, TAURO said: When an form with a UniURLFrame, that load at runtime, is completely loaded and a function scripts js enabled for execute.?? Sorry, maybe I didn't quite understand your question, but you need use this event I guess: procedure TMainForm.UniURLFrame1FrameLoaded(Sender: TObject); begin end; Link to comment Share on other sites More sharing options...
TAURO Posted September 13, 2020 Author Share Posted September 13, 2020 Thanks Yes you understand, but why in this event procedure TFAutoGeoReferencia.UniURLFrame1FrameLoaded(Sender: TObject); begin UniSession.AddJS(UniURLFrame1.JSName+'.iframe.contentWindow.PonerDireccion("'+Domicilio+'"); '); end; occurs the same Ajax error O243.iframe.contentWindow.PonerDireccion is not a function when the function is available for use without button's click??? Why function is only available for button's click but before is not available...??? Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2020 Share Posted September 14, 2020 4 hours ago, TAURO said: Ajax error O243.iframe.contentWindow.PonerDireccion is not a function Hello, Can you please make a simple app to check? Link to comment Share on other sites More sharing options...
TAURO Posted September 14, 2020 Author Share Posted September 14, 2020 Thanks Yes you understand, but why in this event procedure TFAutoGeoReferencia.UniURLFrame1FrameLoaded(Sender: TObject); begin UniSession.AddJS(UniURLFrame1.JSName+'.iframe.contentWindow.PonerDireccion("'+Domicilio+'"); '); end; occurs the same Ajax error O243.iframe.contentWindow.PonerDireccion is not a function when the function is available for use this without button's click??? Hi, here attach a test, with two buttons, one in the html code and other from the UniGui's palette, In the event FrameLoaded the function not work, not trigger the message but can be seen with the browser in debug mode (F12) (index):37 Uncaught TypeError: O13.iframe.contentWindow.PonerDireccion is not a function Test.rar Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2020 Share Posted September 14, 2020 14 minutes ago, TAURO said: Test.rar It seems you haven't attached the project files. Link to comment Share on other sites More sharing options...
TAURO Posted September 14, 2020 Author Share Posted September 14, 2020 Sorry,,, Test.rar Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2020 Share Posted September 14, 2020 6 minutes ago, TAURO said: Test.rar Try this: procedure TMainForm.UniFormCreate(Sender: TObject); begin //uniURLFrame1.HTML.LoadFromFile('test.html'); uniURLFrame1.URL := 'test.html' end; Link to comment Share on other sites More sharing options...
TAURO Posted September 14, 2020 Author Share Posted September 14, 2020 Yesss, now work fine...!!! Thanks!! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now