Niektóre wiadomości nie chcą się otwierać. Otworzyłem konsolę i po kliknięciu w taką nieaktywną wiadomość wyskakuje "Uncaught SyntaxError: Unexpected token ILLEGAL".
Czytałem, że to może być wina js, ale przyczyn może być wiele. Wiadomości nie zawierały żadnych szczególnych znaków to były testowe wiadomości w stylu "asdasd"
Mam sporo kodu, jednak wrzucę, gdyby ktoś miał ochotę na to zerknąć.
<div id="messagebox"> <?php $messages = mysql_query("SELECT * FROM msg WHERE receiver = '".$nick['nick']."' ORDER BY id DESC "); $x = $allmessages['id']; $m = $allmessages['message']; $nickfetch = mysql_fetch_array(mysql_query("SELECT * FROM msg WHERE receiver = '".$nick['nick']."' AND id = '".$x."' ")); $n = $nickfetch['sender']; $s = $allmessages['seen']; echo '<div class="nicklink"><a href="user.php?user=' . $allmessages['sender'] . '">' . $allmessages['sender'] .'</div>'; if ($s == "no"){ echo "<script> $(document.getElementById(".$x.")).css('background-color', '#adff2f'); $(document.getElementById(".$x.")).css('color', 'black'); </script> "; } } ?> </div>
<script> function openmsg(m,n) { $(document).ready(function(){ document.getElementById("messagebox").innerHTML = "<div class='mes'>Wiadomość:<br />" + m + "<br /><br /><a href='mailbox.php' id='wstecz'><button>wstecz</button></a>" + "<a href='respond.php?user=" + n + "' id='wstecz'><button>odpowiedz</button></a></div>"; }); } </script> <script> function seenupdate(x) { $.ajax({ type : "POST", url : "messageseenupdate.php", data : { seen : "YES", id : x } }); } </script>
EDIT: w konsoli błąd wskazuje mi na coś takiego:
<script>(function() {with (this[2]) {with (this[1]) {with (this[0]) {return function(event) {openmsg('wiadomość wiadomość wiadomoooość ','KrolowaJadwiga');seenupdate('98') };}}}})</script>