jComponent / 10. Components
Updated: 17. August 2019
Author: Peter Širka

10. Components

Professional Support Chat with contributors

I have prepared a lot of UI components and you can found they here:

Import components

I have prepared CDN with all components. So you can import components which you are really need. Components are always up-to-date.

<head>
    <link rel="import" href="https://cdn.componentator.com/j-textbox.html" />
    <link rel="import" href="https://cdn.componentator.com/j-textarea.html" />
    <link rel="import" href="https://cdn.componentator.com/j-dropdown.html" />
</head>

Import via IMPORT()

IMPORT('https://cdn.componentator.com/j-textbox.html');
IMPORT('https://cdn.componentator.com/j-textarea.html');
IMPORT('https://cdn.componentator.com/j-dropdown.html');

// With a specific version
IMPORT('https://cdn.componentator.com/j-textbox@1.html');

// Cached
IMPORTCACHE('https://cdn.componentator.com/j-textbox.html', '5 minutes');
IMPORTCACHE('https://cdn.componentator.com/j-textarea.html', '5 minutes');
IMPORTCACHE('https://cdn.componentator.com/j-dropdown.html', '5 minutes');

Fallback for non exist components

jComponent +v14 supports a fallback for non-exist components. The fallback URL is specific in MAIN.defaults.fallback property and it's directed on Componentator CDN provided on KeyCDN.

DEF.fallback = 'https://cdn.componentator.com/j-{0}.html';
// Default value
// jComponent replaces {0} for a component name

DEF.fallbackcache = '2 days';
// Cache fallback components for 2 days
// Components will be cached in localStorage

If the compiler doesn't find some component then it tries to download it according to the fallback URL. If the fallback won't contain any URL then import fallback will be disabled.


All components are under MIT license.