User:Scientific Guy/common.js

From AIOWiki
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
$(function () {
    $('.mw-test-test').html('This is a test');
}());


$(function () {
    console.log("in the function");
    jQuery.ajax({
         url: '//www.aiowiki.com/w/index.php?title=User:Scientific_Guy/JSON&action=raw&templates=expand',
         data: {
             format: 'json'
         }
    }).done(function (episodes) {
	    obj = JSON.parse(episodes);
		for (i = 0; i < 250; i++) {
			document.getElementById('mw-list-ep-json').innerHTML +=
				"<div style=clear:right;float:right;padding-left:5px;><img src=" + obj.episodes[i].albumimage + " height=187.5></div><b>#" +
				obj.episodes[i].num + ": “" + obj.episodes[i].name + "”</b><br>Included in <i>" + obj.episodes[i].album + "</i><br>Aired on " + 
				obj.episodes[i].airdate + "<br>Written by " + obj.episodes[i].writer + "<br>Directed by " + obj.episodes[i].director + 
				"<br>Sound design by " + obj.episodes[i].sound + "<br>Music by " + obj.episodes[i].music + "<p>" + obj.episodes[i].summary + 
				"</p><a href=" + obj.episodes[i].link + "><i>View on AIOWiki</i></a><div style=height:30px></div>" ;
		}
	});
}());