ivirabyan / jquery-mentions

Adds mentioning support to your text fields.
http://ivirabyan.github.io/jquery-mentions/
MIT License
114 stars 49 forks source link

Ajax doesn't work. #58

Open Cleopatria opened 8 years ago

Cleopatria commented 8 years ago

This plugin's great.. but I wonder how to implement this plugin with ajax. I tried using this code

<script> $('.mentions').mentionsInput({source: 'data.json'}) </script>

data.json [ {value: 'alex', uid: 'user:1'}, {value: 'andrew', uid: 'user:2'}, {value: 'angry birds', uid: 'game:5'}, {value: 'assault', uid: 'game:3'} ]

but those name didn't appear.

How to fix it?

ivirabyan commented 8 years ago

You'd better pass absolute path to data.json file, like /path/to/data.json.

Cleopatria commented 8 years ago

So.. I have to make folder named path?

ivirabyan commented 8 years ago

that's not necessary, if it's on your root directory, just pass '/data.json'

Cleopatria commented 8 years ago

Thank you for responding, I've tried to use /path/to/data.json but it's not working.

ivirabyan commented 8 years ago

@Cleopatria, what's the exact uri to your data.json?