diff --git a/README.md b/README.md index 93f0a7f..e8016b1 100644 --- a/README.md +++ b/README.md @@ -6,27 +6,43 @@ Initialize is a framework for buiding web applications. 1. Using CDN -Add the following after JQuery +1) Create a file **config.js** + +```js +var APP_ID = ""; // Your APP unique ID +var WEBSITE_URL = ""; // Your website root URL +var API_URL = ""; // Your website API URL +if (location.hostname === "localhost" || location.hostname === "127.0.0.1" || location.hostname === "") { + WEBSITE_URL = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port; +} +``` + +2) Add to your webpage after the JQuery library ```html - + + ``` 2. Manual -Download the initialize.js library and add to your webpage after JQuery +1) Create a file **config.js** + +```js +var APP_ID = ""; // Your APP unique ID +var WEBSITE_URL = ""; // Your website root URL +var API_URL = ""; // Your website API URL +if (location.hostname === "localhost" || location.hostname === "127.0.0.1" || location.hostname === "") { + WEBSITE_URL = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port; +} +``` + +2) Download the **initialize.js** library and add to your webpage after JQuery ```html - + + ``` @@ -34,6 +50,13 @@ Download the initialize.js library and add to your webpage after JQuery Initialize registers itself under the $$ name. +```js +$(function(){ + var name = $$.getUrlParam('name'); + alert('Your name is ' + name); +}); +``` + ## Methods ## ### $$.get(key) ### @@ -50,7 +73,7 @@ Returns a hash parameter or NULL if not set ### $$.getUrl() ### Returns the current URL -### $$.getUrlParams() ### +### $$.getUrlParam() ### Returns a single query parameter or NULL if not set ```javscript