This is probably something really obvious but I'm new to jquery so don't know what the problem is.
I'm making a simple forum (to see if I can) using php/jquery/html etc. When it's first opened it displays a list of the forums (works fine) and empty boxes(divs) for the other content. When you click on a forum from the list it calls showForum(id) and puts up an alert (just so i know it's working) and that loads a list of the threads in the forum into an empty div (works fine). The problem is when I try to load a thread (by clicking on it), nothing happens, not even the alert.
Jquery code:
$(document).ready(function() {
$('.flink').click(function() {
var id = $(this).attr('id');
showForum(id);
alert("Forum opened");
});
$('.tlink').click(function() {
var id = $(this).attr('id');
showThread(id);
alert("Thread opened");
});
});
function showForum(id) {
$('.topic-container').load("showforum.php", {
'f': +id
});
showLinks(id, 1);
}
function showThread(id) {
$('.entry-container').load("showthread.php", {
'thread': +id
});
showLinks(id, 2);
alert(id);
}
HTML code:
<html>
<head>
<title>
Title
</title>
</head>
<body>
<table class="out-table">
<tr>
<td rowspan="6" class="side-menu">
<table class="side-header">
<?php // Code to get stuff from DB, flinks are created in here. tlinks are created with more php in showforum.php ?>
</table>
</td>
</tr>
<tr>
<td>
<div class="topic-container">
</div>
</td>
</tr>
<tr>
<td>
<div class="top-links">
</div>
</td>
</tr>
<tr>
<td>
<div class="entry-container">
</div>
</td>
</tr>
</table>
</body>
</html>
I've checked the classnames to make sure that they're right. I made clicking on a forum open call showThread (just to make sure the function worked) and it worked fine.
Any help anyone can give will be greatly appreciated.