Created
August 7, 2012 15:36
-
-
Save PelnaE/3286471 to your computer and use it in GitHub Desktop.
My attemp to learn jQuery!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".subject").click( function() { | |
var count = 0; | |
var message_id = $(".subject").data("message-id"); | |
if (count == 0) { | |
$.get("/friends_com/messages/view/"+message_id+"", function(data) { | |
count = 1; | |
console.log(data + count); | |
$("#message_content").html(data + count); | |
}); | |
} else if (count == 1) { | |
count = 0; | |
console.log('error'); | |
$("#message_content").slideToggle("fast"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment