Jump to content

Problem with loading Custom files for scripts and css


MarBar77

Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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>

 

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...