What is the best practice to make anvil app looks good on mobile device?

@adhamfaisal the form show is an event that is triggered when the form is visible on the screen.

if the form is not visible then:

  • it doesn’t have it’s html loaded, and so
  • it doesn’t have it’s <script> tags loaded, and so
  • it can’t call it’s js function(s).

As a similar alternative approach:

  • you could put @joinlook’s function in native libraries:
    (this will insert the function into the <head> tags of the app)
  • This way you can access the function anywhere at anytime from any form.
  • just call js.call_js('measure_this') instead of self.call_js

https://anvil.works/build#clone:VPLZWVEU2CEDMQW5=XSS6HNCKZARSFYRD6YCVLNW3

4 Likes