Skip to content

Commit

Permalink
Formating the javascript code in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
geokongo committed Jul 12, 2016
1 parent 503a911 commit 34e77c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,30 +112,32 @@ You can choose to append the content of the input field to the ajax url. The val

```javascript
$(".airports").autosuggest({
ajaxurl: "localhost:3000/app/getairports/states",
ajaxurl: "localhost:3000/app/getairports",
setparams: true
});
```

This becomes:

` localhost:3000/app/getairports/states?query=sydney `
` localhost:3000/app/getairports?query=sydney `


If you have other parameters to pass along, you can pass them as an object parameter and they will be appending as a get string to the url.

```javascript
$(".airports").autosuggest({
ajaxurl: "localhost:3000/app/getairports/states",
ajaxurl: "localhost:3000/app/getairports",
setparams: true,
urlparams: {
param1: value1,
param2: value2
}
});
```

This becomes:

` localhost:3000/app/getairports/states?query=sydney&param1=value1&param2=value2 `
` localhost:3000/app/getairports?query=sydney&param1=value1&param2=value2 `


### <a name="cache"> Session caching of Data Array </a> ###
Expand Down

0 comments on commit 34e77c3

Please sign in to comment.