Alloy ui basic tutorial

people

Dev

. min read

Few points about alloy ui : Alloy ui is a library which built on the top YUI3 library. It uses the concept of sandbox. It is a meta framework for building rich ui web pages.

Sandbox concept for js:

This concept uses the call back concept for running the code. It provides the functionality of adding the module (s) on demand for accessing its defined functions. How to create sandbox?

YUI().use(arg1,arg2…….argn,function(A){

//code will be added here.

});

Let us discuss about the above created sandbox.

  1. YUI () function creates new instance of YUI.
  2. On this new instance use method is being called which can zero or n no. of modules as a string parameters but last parameter will be a callback function.
  3. Here function (A) is a callback function and it is having A as an argument which nothing but new instance which is being created by YUI () function.
  4. it loads the dependencies which are e being called as modules here on demand.

Let’s create a simple hello world example to demonstrate the above

The following steps needs to be followed in order to create a hello world:

  1. Add the seed file (which is like a js library file) to the using < script > tag and related css file.
  2. Create the sandbox as mentioned above.
  3. Now supply an alert message to this sandbox.

Seed js file and css file

http://cdn.alloyui.com/2.0.0/aui/aui-min.js 

http://cdn.alloyui.com/2.0.0/aui-css/css/bootstrap.min.css

< script >

var checkObj=YUI();

checkObj.use(function(A){

alert("Hello World");

});

< /script >


Live Demo : Alloyui Basic Test

Let’s discuss how to use packages in the next tutorial in the series of basics of alloy ui.

More Stories from

Dev
Dev.2 min read

Window Server 2025 Contabo VPS Install Guide

Window server in contabo is very costly but you can deploy your license key with custom image.

Dev
Dev.1 min read

Setting up SSH keys to a Ubuntu Server with Mac

Generating SSH keys on a Mac for use with an Ubuntu server is a straightforward process. Here’s a step-by-step guide: Generate the SSH Key Pair

.
Lets Try
Lets Try.8 min read

Deploy Boxcoin SAAS on VPS Ubuntu Nginx Server

Looking for the fastest way to run Boxcoin Crypto SAAS on Ubuntu server? We cover the full installation process on Self-Managed VPS of webdock, hetzner, aws

.
Lets Try
Lets Try.4 min read

Set Up Daily MySQL Backups to DigitalOcean Spaces (S3-Compatible)

Step-by-Step Guide to implement Automated MySQL Database Backup to DigitalOcean Spaces or s3 compatible buckets (With Retention & Logs) on Ubuntu server.

.
Lets Try
Lets Try.3 min read

Raspberry Pi NAS: Install OpenMediaVault + CasaOS (Step-by-Step Guide)

Turn your Raspberry Pi into a powerful NAS by installing OMV for RAID storage and CasaOS for a simple UI—build a secure, user-friendly home cloud.

Built on Koows