Looking to utilize vanilla JavaScript to retrieve data from the MeetUp API. The code snippet being used on the website is as follows:
function addScript(src) {
console.log(src);
var s = document.createElement( 'script' );
s.setAttribute( 'src', src );
document.body.appendChild( s );
}
addScript('https://api.meetup.com/2/groups?callback=?&sign=true&member_id=8377069&page=20&api&key=API_KEY_GOES_HERE&only=name,link');
A script tag has been employed to access the data in order to circumvent cross-domain issues. While acknowledging jQuery could address this, I prefer not to rely on external libraries.
However, the provided code yields the following error:
Uncaught SyntaxError: Unexpected token :
This issue likely arises due to the JSON format of the return. How can this be resolved while still ensuring access to the JSON data? Your assistance is greatly appreciated.
For an example link, kindly refer to: http://jsfiddle.net/londonfed/7ms44ft6/