Get children categories

 

Simple Accordion Code

No complicated code. Just a tiny script:

HTML:

Javascript:

Add Window OnLoad Event (plain Javascript)

If you run into a situation where you need to add a window.onload event, and you cannot rely on a library to do the work (no jQuery), you can use old school, plain javascript, here is what you can do:

Load Vue Components at Runtime (on-demand)

Can Vue components be loaded at runtime, after I initialize my application? Well, the answer is yes, but it is not the most common scenario.

Consider a scenario in which you have a large application and user may not need to access all its functionality every single time. For instance, you do not expect your users to unsubscribe from your web application every single time (one unsubscribe and they are gone for ever). So, it makes sense for any feature that is not used on a regular basis, to be load on demand.

Here is the logic:

  1. Load your application the same you typically do
  2. Load the deferred component (e.g. jQuery.load(selector, callback)
  3. Create an instance of your component
  4. Mount it
  5. Attach it to your app

Component code

Loader code