External Javascript defer loading

Forum to discuss the new web client version of Servoy.

External Javascript defer loading

Postby tom » Wed Feb 01, 2017 1:56 pm

Hello


I'm quite new to Servoy NG, so this may be a stupid question. However, I try to achieve that a specific external .js-file is loaded after the page has loaded. In HTML I would do that like this:

Code: Select all
<script defer src="https://code.whatever.com/external-file.min.js"></script>


How can this be done in NG-client? Thanks in advance!


Regards

Tom
tom
 
Posts: 7
Joined: Mon Jan 23, 2017 4:29 pm
Location: Antwerp, Belgium

Re: External Javascript defer loading

Postby jcompagner » Wed Feb 01, 2017 6:29 pm

thats not directly possible

Or you have to have your own servoy ngclient service that injects that script tag with that defer when your service is loaded
Then i guess it will really be lazy.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: External Javascript defer loading

Postby patrick » Wed Feb 01, 2017 6:34 pm

What do you want to do with that external js once it is loaded? Why is "lazy" loading important for you?
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: External Javascript defer loading

Postby tom » Thu Feb 02, 2017 10:59 am

Hi Patrick


I'd like to 'pimp' my interface. The lazy loading is needed for extra functionality (more as in 'visual effects'). I use a library for this: https://getmdl.io

In the first place I am a webdesigner, forced to use Servoy. I still have difficulties to fully understand how Servoy renders the webpage, and how to adapt the interface to my wishes. I'm still thinking as a webdesigner... :?


Grtz

Tom
tom
 
Posts: 7
Joined: Mon Jan 23, 2017 4:29 pm
Location: Antwerp, Belgium

Re: External Javascript defer loading

Postby patrick » Thu Feb 02, 2017 11:51 am

From shortly looking at this, I think the best would be to build web components for specific UI elements you would like to use. See https://wiki.servoy.com/display/DOCS/WebComponents for an overview.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: External Javascript defer loading

Postby jcompagner » Thu Feb 02, 2017 12:02 pm

i don't get why you use lazy loading for?
Is that just to depend on a the visual affect that happens when it is lazy loaded? (so it is completely depending on the browsers and fast speed of the internet connection of the user?)
That looks very weird to me to depend on that
i think that defer is just a speed up. If you know that library is not used right away but only later on (and the creating of the dom doesn't depend on it) then you can do defer so the browser doesn't block on the load.
So for me it is a performances thing not something useful for anything else, but i could be wrong
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: External Javascript defer loading

Postby sbutler » Thu Feb 02, 2017 4:50 pm

tom wrote:I'd like to 'pimp' my interface. The lazy loading is needed for extra functionality (more as in 'visual effects'). I use a library for this: https://getmdl.io

In the first place I am a webdesigner, forced to use Servoy. I still have difficulties to fully understand how Servoy renders the webpage, and how to adapt the interface to my wishes. I'm still thinking as a webdesigner... :?


Yes. That package wouldn't work for you anyway. Its really meant for static sites. See their note about "Use MDL on dynamic websites". Servoy updates content dynamically, so that would be a nightmare.

You should still think like a webdesigner, but it needs a bit of tweaking. Servoy has Bootstrap components available (labeled as the 12grid package). So as you place your elements on the interface, you can assign multiple CSS classes and use what comes in Bootstrap, and of course add your own CSS style sheet. Personally, I sometimes start with this site: http://bootstrap-live-customizer.com/ . You can generate your Booststrap theme or choose from some defaults. Click download and get the .css version and paste that into your CSS your using for your solution. That gets a base theme started for you.

I'm teaching a training in CA in a couple of weeks mostly on building nice interfaces in Servoy 8, so I'll try to put together something I can share.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: External Javascript defer loading

Postby tom » Fri Feb 03, 2017 12:05 pm

Thanks for all the input! A day without learning is a day wasted :D

Very excited to dive into the web components. Together with the base Bootstrap theme provided, I will definitely make some progress on this issue.

John, if you're able to share some info from your training, that would be wonderful! Thanks in advance, and long live the internet.


Have a nice weekend you all,

Tom
tom
 
Posts: 7
Joined: Mon Jan 23, 2017 4:29 pm
Location: Antwerp, Belgium


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 4 guests