Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KiraLT committed Feb 10, 2015
1 parent f72cdaf commit 136df1d
Showing 1 changed file with 73 additions and 1 deletion.
74 changes: 73 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,74 @@
# Bjax
# Welcome to Bjax 1.0.0

## About

Ajax link system for modern website. Convert any link in your page to ajax link.

## Usage

```
$('[selector]').bjax(options);
```

### Binding

#### Bind every link

*JavaScript*

```
$('a').bjax();
```

*HTML*

```
<a href="/page">Page</page>
```

#### Bind by data-bjax attribute

*JavaScript*

```
$('[data-bjax]').bjax();
```

*HTML*

```
<a href="/page" data-bjax>Page</page>
```

#### Use cases

### Load whole new page

```
<a href="/page" data-bjax>Page</page>
```

### Load a part of page

```
<a href="/page" data-target="#content_target" data-element="#content_element">Page</page>
```

### Load a part of page without changing current url

```
<a href="/page" data-target="#content_target" data-element="#content_element" data-replace="false">Page</page>
```

### Options

Option | Default | Description
--- | --- | ---
url_attribute | data-href or href | URL attribute
url | undefined | custom url
replace_attribute | data-replace | Replace attribute
replace | true | Change page URL after bjax load
element_attribute | data-el | Element attribute
element | html | Element to load
target_attribute | data-target | Target attribute
target | html | Load target

0 comments on commit 136df1d

Please sign in to comment.