MediaWiki:Zerospace EN.js

From OGC
Revision as of 15:03, 25 April 2018 by Admin (talk | contribs)
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 generate_alien_type()
{
	alien_type_roll = 14;

	if (alien_type_roll <= 13)
	{
		alien_type = 'Humanoid alien';
	}
	else if (alien_type_roll <= 15)
	{
		alien_type = 'Android;
	}
	else
	{
		alien_type = 'Exotic alien';
	}

	return alien_type;
}

function generate_alien()
{
	var random_alien = '';

	random_alien = generate_alien_type();
	document.getElementById("random_alien_title").innerHTML = 'Your Random Alien';
	document.getElementById("random_alien_output").innerHTML = random_alien;
}

$(function () {
	var random_alien_title = document.getElementById('random_alien_title');
	var random_alien_button = document.getElementById('random_alien_button');

	random_alien_title.innerHTML = 'Randomly Generate An Alien';
	random_alien_button.innerHTML = '<input type="button" value="Generate An Alien" onclick="generate_alien();" />';
}());