jQuery ajax
If you want to dynamically load content into your page chances are your going to need to do some sort of request to a server in the background. The simplest way of doing this is to use jQuery's ajax function.
Here's an example of a GET request and a POST request:
1$.ajax({2 type: "POST", // Set the HTTP type to POST3 url: "/serviceurl.aspx", // URL of the service4 data: "{data: [{"Field1": 1}] }", // Data to be posted to the service5 processData: false, // If set to true the data will be processed and turned into a query string6 success: (function (result) {7 // Result of the service call8 }),9 error: (function (jqXHR, textStatus, errorThrown) {10 alert(errorThrown);11 })12});1314$.ajax({15 type: "GET", // Set the HTTP type to GET16 url: "/serviceurl.aspx", // URL of the service17 dataType: "jsonp", // Set what type of data you want back18 success: (function (result) {19 // Function that will be called on success20 })21});