1

hi guys i need some help since im new with jquery.

Im using jquery to load something in a div. Here is my code

$('.menu_top').click(function(){

    var href = $(this).attr('href');

    $('#main_section').hide().load(href).slideDown("normal");

    //slideDown("normal");
    //fadeIn("normal");
    //fadeToggle("slow", "swing");

    return false;
});

Everything works fine

I also have my php pages divided into pieces like header.php, footer.php etc.

The problem comes when i try to sent a post data to the same page, for example post from home.php to home.php. The headers and footers just dissapear.

I've tried to use stuff like

if(isset and !empty){
  //put the headers
}

But that didnt work....

Thanks for the help

4

2 回答 2

0

You need to check for $_POST:

if(isset($_POST['your_post_value'])){
// the POST value exists
}
于 2013-03-31T22:06:44.517 回答
0
$('#main_section').hide().load(href, function() { $(this).slideDown("normal"); });

.load 的第二个参数是加载完成时应该调用的处理程序。然后你向下滑动

于 2013-04-01T09:18:04.333 回答