MarBar77 Posted May 19, 2022 Share Posted May 19, 2022 I am making mobile application using TUniMobile components. I have declared in CustomFiles: mobilefiles/signature_pad.js mobilefiles/app.js mobilefiles/css/signature-pad.css and it works for few days. Now after developing my App for two weeks I have noticed that those JavaScripst does not work any more. I get a messag that signaturePad is notDefined. It looks like a problem with loading files that works a little time ago? What is the reason for this behaviour. How could I force the app to load that scripts? Marcin Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 Hello, What if you restart the app? Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 It does not help. I have made a new simple application and it works. Now I am thinking what could happen and prevent scipts from loading. For this moment my app has 16 forms ?? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 Just now, MarBar77 said: It does not help. I have made a new simple application and it works. Are you sure that the files are located in the correct path? Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 Yes I am sure. I am "fighting" with this for 3 days right now. Maybe I shuould force to reload those scripts in runtime before showing form that use tthose scipts? I have MainForm, and every other form are displayed in Frame of MainForm. Maybe this make a problem? Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 Here is the HTML that is pasted to TunimTHTMLFrame <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Signature Pad</title> <meta name="description" content="Signature Pad - HTML5 canvas based smooth signature drawing using variable width spline interpolation."> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <link rel="stylesheet" href="mobilefiles/css/signature-pad.css"> </head> <body onselectstart="return false"> <div id="signature-pad" class="m-signature-pad"> <div class="m-signature-pad--body"> <canvas></canvas> </div> <div class="m-signature-pad--footer"> </div </div> <script src="mobilefiles/signature_pad.js"></script> <script src="mobilefiles/app.js"></script> </body> </html> Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 The same work with simple app with one form. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 You need to check again, you say it worked before. Maybe you changed something, changed from Debug Mode to Release Mode? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 8 minutes ago, MarBar77 said: mobilefiles/css/signature-pad.css What is the full path to the file? Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 d:\PROJECTS\DELPHI\PROHMSTAL\SOS\Debug\Win32\mobilefiles\css\signature-pad.css Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 UniServerModule.FilesFolder = ? Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 mobilefiles\ Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 Just checked with my SVN with working version nothing changes between two weeks except adding new forms Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 Are there errors in the browser console? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 If you check on a desktop browser. Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 It is a message in the browser. See attached screenshot. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 19, 2022 Share Posted May 19, 2022 Open the developer console. (F12) Quote Link to comment Share on other sites More sharing options...
MarBar77 Posted May 19, 2022 Author Share Posted May 19, 2022 You are great :). Problem with Cache. Hitting CTRL+F5 resolves my problem :D. Thank you Sherzod. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted May 20, 2022 Share Posted May 20, 2022 10 hours ago, MarBar77 said: You are great :). Problem with Cache. Hitting CTRL+F5 resolves my problem :D. Thank you Sherzod. this can be useful: on procedure TUniServerModule.UniGUIServerModuleHTTPCommand( just add this headers: AResponseInfo.CustomHeaders.AddValue('Cache-Control', 'no-cache, no-store, must-revalidate'); //HTTP 1.1 AResponseInfo.CustomHeaders.AddValue('Pragma','no-cache');////HTTP 1.0 AResponseInfo.CustomHeaders.AddValue('Expires', '0'); documented and explained here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html this maybe will extend data transfer between Client and Server (will use more traffic) Quote Link to comment Share on other sites More sharing options...
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.