Skip to content

Commit

Permalink
Merge pull request
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
lesichkovm authored Sep 10, 2019
2 parents eba7a0b + d7a1e6e commit d8717c9
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,57 @@ 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
<script>
var APP_ID = ""; // Your APP unique ID
var WEBSITE_URL = ""; // Your website root URL
var API_URL = ""; // Your website API URL
</script>
<script src="jquery.js"></script>
<script src="config.js"></script>
<script src="https://cdn.jsdelivr.net/gh/lesichkovm/[email protected]/initialize.js"></script>
```

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
<script>
var APP_ID = ""; // Your APP unique ID
var WEBSITE_URL = ""; // Your website root URL
var API_URL = ""; // Your website API URL
</script>
<script src="jquery.js"></script>
<script src="config.js"></script>
<script src="initialize.js"></script>
```

# Usage #

Initialize registers itself under the $$ name.

```js
$(function(){
var name = $$.getUrlParam('name');
alert('Your name is ' + name);
});
```

## Methods ##

### $$.get(key) ###
Expand All @@ -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
Expand Down

0 comments on commit d8717c9

Please sign in to comment.