0

I would like to know if I can put two page in load Example :

$(function() {
    $(".dislike<?php echo $rapport['id']; ?>").click(function(evt) {
        $("#lik<?php echo $rapport['id']; ?>").load("dislike.php?is=<?php echo $rapport['id']; ?>")
        $("#lik<?php echo $rapport['id']; ?>").load("showdislike.php?is=<?php echo $rapport['id']; ?>")
    });
});

It's a like / dislike system

Thanks !

guest
  • 6,450
  • 30
  • 44
Roussy
  • 1
  • 1
    I wouldn't use `load()` for the first AJAX call but [`jQuery.get()`](http://api.jquery.com/jQuery.get/) or [`jQuery.post()`](http://api.jquery.com/jQuery.post/). – Hauke P. May 22 '14 at 22:34

1 Answers1

0

$.load will erase the current content of the element. You should have a look to this question

Can jQuery .load append instead of replace?

and use $.getas they suggest

EDIT:

I would like to post with the first link and after reload the div on my page without refresh my principal page.

$.post(first_link).done(function() {
    my_div.load(second_link)
});

Instead of .done, you can use .success or .failif you need to handle some special case: see http://api.jquery.com/category/deferred-object/

Community
  • 1
  • 1
Baptiste Pernet
  • 3,318
  • 22
  • 47
  • Can you make an example I don't uderstand your link ... I explain my problem in details. I would like to post with the first link and after reload the div on my page without refresh my principal page. – Roussy May 22 '14 at 22:44