surprised that the $.post is working since it looks like you're trying
to do a cross-domain request, but anyway, the problem could be that
you don't have a return false or preventdefault() anywhere. Try this:
$("a").click (function(event) {
event.preventDefault();
// rest of your code ...
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Nov 8, 2008, at 8:47 PM, Althalos wrote:
Hi. I am trying to make a div slide up, update through $.post and then
slide down again. I have the following code:
$("a").click (function() {
$("#content").slideUp('slow', function () {
$.post('http://uf.ekdahlproduction.com/itsvintage/text.php',
{site: $(this).attr('rel')}, function(data) {
$("#content").html(data);
$("#content").slideDown('slow');
});
});
});
However, the div just goes up and down without any content on it. Can
anyone help me sort this out?
(I know the post thingy is working, because it works if I write the
$.post and its callback outside the callback function of slideUp.
Then, however, it will be possible to see the new content when it's
still on its way up)
thank you