hi i'm building something like a posts gallery and i want to do the following: 1. have thumbnail for each post 2. when a thumbnail is clicked, i want the new post to be loaded at a div at the top of the page w/o the posts gallery changing. to do that i want to pass the id of the clicked-on post to that div and then run the query_string there.
i got my thumbnail click function:
$(".thumb").click(function(){
myLink=$(this).attr('href');
// get the post id into pID by finding p= and then extracting the next char after = from the link
var t = myLink.indexOf("p=");
var l = myLink.length;
var pID = myLink.substring(t+2,l);
$("#target").post('/?page_id=9', { postID: pID } );
$("#target").load("/?page_id=9");
return false;
});
My problem is: $.post doesn't work. i've tried it with the $.ajax syntax too, and it still doesn't work. (it seems like the jQuery is aborted midway, as any alerts i put in the post or ajax callback functions are being ignored).
Please help...