Fixed bug with JQuery .load()
diff --git a/js/animations.js b/js/animations.js
index 4af9929..5ceebf9 100644
--- a/js/animations.js
+++ b/js/animations.js
@@ -1,6 +1,6 @@
function change_victim(user) {
$(".victima").fadeOut(400, function() {
- $(".victima").load('./ajax/victiminfo.php?userid=' + user.id + " .victima");
+ $(".victima").load('./ajax/victiminfo.php?userid=' + user.id + " #victim_info");
$(".victima").fadeIn(400);
});
}
diff --git a/js/utils.js b/js/utils.js
index e35b5cb..47ab686 100644
--- a/js/utils.js
+++ b/js/utils.js
@@ -35,7 +35,7 @@
if (info.requested) {
// Check for requests
if(info.requested) dead = confirm("El teu assassí ha dit que t'ha matat, és veritat?");
-
+
// Confirm/deny request
if (dead) send_request(user, "CONF DEAD"); // confirm death
else send_request(user, "DENY REQ"); // deny kill/death
@@ -56,11 +56,11 @@
// Check if user is dead
if (!user.mort) user.mort = check_requests(info, user);
- else window.location.href= "./dead.php";
// Check if there has been a change of victim
if (info.quimata != user.quimata) {
- change_victim(info);
+ if (!user.mort) change_victim(info);
+ else window.location.href = "./dead.php";
user.quimata = info.quimata;
}