[eluser]A.M.F[/eluser]
i have articles' list that i echo in one page.
after the list i have a block and inside the block i want to load each article with jQuery so i have this JS script:
Code:
$(document).ready(function() {
$("#msg_list a[@class='msg']").click(function(){
$.post("<?=site_url_rel("profile/pm/6")?>", {msg_list: $(this).html()}, function(xml) {
$("#the_msg").html(
$("test", xml).text()
);
});
return false;
});
});
this is my HTML:
Code:
<div id="the_msg" style="float: left; border:1px #000 solid; display:block; width:60%; margin:5px; padding:5px;">
*** ARTICLE's CONTENT BLOCK ****
</div>
<!-- articles' list -->
<div id="msg_list">
<a href="#" class="msg">test</a>
</div>
and finally, that's my pm function in the controller:
Code:
function pm($pm_id = '')
{
// -- check data: --
$pm_id = $this->uri->segment(3, TRUE);
if ((!is_numeric($pm_id)) || ($pm_id == '')) show_error('ההודעה לא נמצאה');
$pm_id = htmlspecialchars($pm_id, ENT_QUOTES);
// --- get message --->
$query = $this->db->query("SELECT * FROM `messages` WHERE `msg_id`='{$pm_id}'");
if ($query->num_rows == 0) show_error('ההודעה לא נמצאה');
$row = $query->row();
$title = $row->msg_title;
$content = $row->msg_content;
// ---------------->
$xml = "<msg_list><test>12</test></msg_list>";
header('Content-type: text/xml');
echo $xml;
}
the result is this: when i click on the link - nothing happens.
why?
thank u for ur time