I have the the AngularJS as following:
(function() {
'use strict';
angular
.module('ui-chat-app')
.factory('wikiService', function($http) {
var wikiService = {
get: function(keyword) {
return $http.jsonp('https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exlimit=1&explaintext&exintro&titles=' + keyword.name);
}
};
return wikiService;
})
.controller('aiChatBrain', function($scope, wikiService) {
wikiService.get({name: 'Sarajevo'}).then(function(data) {
console.log(data);
});
});
})();
When the script is executed in firefox I get the following error:
And when the script is executed in chrome I get the following error:
Any idea why this is happening ? :/ I'm totally confused...
Can someone help me out with this please?
Thanks heaps!