Skip to content

Latest commit

 

History

History
 
 

plain-javascript

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Hello World (plain javascript)

The demo contains one single file:

.
└── index.html

Before running it, execute the requirements below.

Requirements

1. Dependencies

The demo requires Globalize and its dependencies. Globalize's dependencies are listed on Getting Started, and the only one is cldrjs. You are free to fetch it the way you want. But, as an exercise of this demo, we'll download it ourselves. So:

  1. Click at Globalize releases tab.
  2. Download the latest package.
  3. Unzip it.
  4. Rename the extracted directory globalize and move it alongside index.html and README.md.
  5. Click at cldrjs releases tab.
  6. Download the latest package.
  7. Unzip it.
  8. Rename the extracted directory cldrjs and move it alongside index.html and README.md.

Then, you'll get this:

.
├── cldrjs
│   └── dist
│       ├── cldr.js
│       ├── ...
│       └── cldr
│           ├── event.js
│           ├── supplemental.js
│           └── ...
├── globalize
│   └── dist
│       ├── globalize.js
│       ├── ...
│       └── globalize
│           ├── currency.js
│           ├── date.js
│           └── ...
├── index.html
└── README.md

For more information read cldrjs' usage and installation docs.

2. CLDR content

Another typical Globalize requirement is to fetch CLDR content yourself. But, on this demo we made the things a little easier for you: we've embedded static JSON into the demo. So, you don't need to actually fetch it anywhere. For more information about fetching Unicode CLDR JSON data, see How do I get CLDR data?.

No action needed here.

3. Globalize dist files

This step only applies if you are building the source files. If you have downloaded a ZIP or a TAR.GZ or are using a package manager (such as bower or npm) to install then you can ignore this step.

Install the development external dependencies and build the distribution files.

Running the demo

Once you've completed the requirements above:

  1. Point your browser at ./index.html.
  2. Open your JavaScript console to see the demo output.
  3. Understand the demo by reading the source code. We have comments there for you.