Problem with Random Code Machine

Problem with Random Code Machine
0.0 0


My Random Quote Machine was working fine apart from I had trouble of open the twitter message box in order to tweet quotes. Now all the code stopped working together. Please help! Here is my url :


You have many errors showing in your browser’s console that you need to fix. Also, your code is not easy to read, because you are not indenting your code. Clean it up and I will take a look at it.


Below, I have corrected all your errors, reorganized your code so all your global functions are at the top , and I indented the code.

You were missing closing parentheses in some parts of your code and you were missing some closing brackets in other parts.

function showTime() {
  var time = document.getElementById("time");
  time.innerHTML = Date();

function tweet() {"" + $("#quote").html() + " By" + $("#author").html());

function hideTime() {
  var time = document.getElementById("time");
  time.innerHTML = "";

function animate() {

function quote(url) {
  $("#author").innerHTML = "";
  $("#quote").innerHTML = "";
  url = "";
  $.getJSON(url, function(data) {

$("#getQuote").on("mouseenter", showTime);
$("#getQuote").on("mouseleave", hideTime);
$("#getQuote").on("click", animate);
$("#getQuote").on("click", quote);

$("#me").click(function() {
  function change() {
    $("#heading").css("color", "yellow").slideUp(2000, color);

  function color() {
    function again() {
      $("#heading").css("color", "blue");
      .css("color", "green").slideDown(2000, again);
  $("#heading").css("color", "yellow");
  setInterval(change, 2000);
  setInterval(color, 3000);

$("#tweetOut").on("click", tweet);


Thank you very very much!