Skip to content

$getJSON() not working #89

@marmz

Description

@marmz

I tried to put the same source of demo in an external file:

mentions.json

code:

[
        { name: 'Tyra Porcelli' }, 
        { name: 'Brigid Reddish' },
        { name: 'Ashely Buckler' },
        { name: 'Teddy Whelan' }
]

then fetch it like suggested:

code:

mentions: {
	source: function (query, process, delimiter) {
		// Do your ajax call
		// When using multiple delimiters you can alter the query depending on the delimiter used
		if (delimiter === '@') {

		   $.getJSON(baseurl+'mentions.json', function (data) {
			  //call process to show the result
			  process(data);
		   });

		   
		}
	}
}

No errors in console but, when pressing "@", i got an empty popup..
Any ideas?

PS: When loading items with source (without using $.getSON for external file) everything works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions