WebSDK (Custom Control) Headers

I am making heavy use of the Web SDK in my web app. Can I confirm that it is the case that with a custom control in a project but no instance (implicit) that the HTMLHeader shared method gets called in any case and the headers included ?

Hope this makes sense ?

Steve

Anybody have any experience with this ? I note this regarding HTMLHeader shared method in the docs:

HTMLHeader(CurrentSession as WebSession) as String
Override this shared method to dynamically add items to the
head section of the session as it loads.

So, in my case, where my app may have 10+ custom controls, as it stands, all headers for all controls will be loaded at session open.

Has anybody worked around this ? Naturally the question comes from the fact that I may wish to have different versions of say jQuery being used with different controls for example. Additionally pulling down numerous assets, all up front, is less than ideal.

Any suggestions / experiences ?

Thanks,
Steve

I really do not suggest having different versions of jQuery for different controls. Xojo Web apps are all one html page with different views being swapped in as necessary, so everything on the page must be able to exist at the same time.

You can instantiate jQuery using noConflict if you absolutely MUST have different versions loaded. GraffitiSuite loads a single version of jQuery in noConflict mode to reduce collisions with other vendors’ products.

noConflict basically reassigns the last loaded version from $ to some other name.

Thanks @Greg_O_Lone - it is moreso for the reason tgat @Anthony_Cyphers mentioned. Thanks @Anthony_Cyphers I had come across that previously and will need to use it I think.

Guess then the real issue is having lots of external assets pulled down, irrespective of their use (dybamically creating instances so there is no guarantee that assets fir a given control will ever be needed despite being pulled down). Guess I coul d rationalise into fewer files at least…

When possible, you should minimize and combine your resources. It also helps a great deal to host them on a traditional server rather than via your Xojo web app. I have options for offloading resources built in to GraffitiSuite, and the loading speed difference is like night and day.

Yep I’ll combine and minimize :+1: I have Apache set up on my vps to serve assets (amongst other things)