Board Thread:General Coding Help/@comment-32922752-20181003142914

My javascript code in common.js can print a number, but i don't know how to call that code to print the number in pages. How can I call that code?

Here's my code in common.js: function getViewCount { $.getJSON('https://www.googleapis.com/youtube/v3/videos?part=statistics&id=kJQP7kiw5Fk&key=AIzaSyAovb7xAE_oNZrxTJm1JAbKTMpt92fgzzo', function(data) {        var viewCount = data.items[0].statistics.viewCount;         $('body').append(formatNumber(viewCount));     }); } getViewCount; In HTML pages ,I can use the following code to print the number



But it seems not working in fandom pages. 