I have a simple input field, in which when the user starts typing it will call the place-search.js script. When I start typing I get the following error:
Uncaught (in promise) Error: Uncaught, unspecified "error" event. ([object Response])
here is the function that listens for user input in the text field.
function addlistener(id){
// This example will load jQuery dynamically, but this could be any script...
loadScripts({
test: function() { return typeof placeSearch !== 'undefined'; },
scripts: 'https://api.mqcdn.com/sdk/place-search-js/v1.0.0/place-search.js',
done: function() {
placeSearch({
key: key,
container: document.querySelector('#'+id),
useDeviceLocation: useDeviceLocation,
collection: collection
});
}
});
}
Can someone explain what this error means, or how to go about fixing it? Any guidance or help would be appreciated.
Is there someplace we can see this running now? Can you confirm the place-search.js file has successfully loaded before it is called?