How to send data via Javascript - Jquery
How 开发者_如何学JAVAto send data via Javascript - Jquery
If you want to send some data to a server side script your could use AJAX. jQuery has great support through $.ajax()
, $.post()
, $.get()
, $.getJSON()
:
$.ajax({
url: '/script',
data: { key1: 'value 1', key2: 'value 2' },
success: function(result) {
alert('data successfully sent');
}
});
$.post() or $.send() www.jquery.com
$.ajax({
url: url_page,
data: ({id: 1, data: 1212}),
dataType: 'json'
});
精彩评论