pangi
pangi

Reputation: 2723

Jquery and Ajax - trigger load with button

I'm trying to make a page, where the content is shown using jquery.
When the user comes to the website, the content is loaded from datanbase.
I would like to add a button, that would trigger the load of new data from database, but on the same page. How do I do this? :)

Upvotes: 0

Views: 71

Answers (1)

defau1t
defau1t

Reputation: 10619

Something Like below should help you get started:

$(function() {
            $.ajax({
                type:'POST',
                url:'path/to/database file',
                success: function() {
                        $("body").append(whatever you want to add);

                }
                });
                });

Upvotes: 1

Related Questions