TAURO Posted September 13, 2020 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; Quote
Sherzod Posted September 13, 2020 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; Quote
TAURO Posted September 13, 2020 Author 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...??? Quote
Sherzod Posted September 14, 2020 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? Quote
TAURO Posted September 14, 2020 Author 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 Quote
Sherzod Posted September 14, 2020 Posted September 14, 2020 14 minutes ago, TAURO said: Test.rar It seems you haven't attached the project files. Quote
Sherzod Posted September 14, 2020 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; Quote
TAURO Posted September 14, 2020 Author Posted September 14, 2020 Yesss, now work fine...!!! Thanks!! 1 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.