Check alle échte Black Friday-deals Ook zo moe van nepaanbiedingen? Wij laten alleen échte deals zien
Toon posts:

[jquery] hoe resultaat $.ajax() in DIV weergeven?

Pagina: 1
Acties:
  • 367 views

Verwijderd

Topicstarter
Hoi,

Hoe kan ik het resultaat van onderstaande in een DIV weergeven?
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
Ik kan dit doen met
$("#wijzigen_4").click(function(){
$("#popup2").load('organizer_process.php");
});
en de variabelen aan de URL hangen en er met $_GET uithalen, maar dit lijkt me niet de ideale manier? Misschien moet dit beter met POST en de eerste functie?

thanks,

Matt

Verwijderd

Topicstarter
gevonden:

code:
1
2
3
4
5
6
7
8
9
10
        $.ajax({
            type: "POST",
            url: "organizer_process.php",
            data: 'id='+id,
            cache: false,
            success: function(data){            
                // Insert the returned HTML into the <div>.
                $('#popup2').html(data);
            }
        })

  • XangadiX
  • Registratie: Oktober 2000
  • Laatst online: 26-05 15:01

XangadiX

trepanatie is zóó kinderachtig

Stoer; Marduq


Dit topic is gesloten.