1jQuery(function() { 2 jQuery('.wiki_slice_form').submit(function() { 3 var sectok = jQuery(this).find("input[name=sectok]").val(); 4 var from = jQuery(this).find("input[name=from]").val(); 5 var to = jQuery(this).find("input[name=to]").val(); 6 jQuery.ajax(DOKU_BASE.concat('lib/exe/ajax.php'), { 7 data: { 8 call: 'components.example', 9 sectok: sectok, 10 id: JSINFO["id"], 11 range: {from: from, to: to} 12 // note that javascript arrays must use the form 13 // some_var: JSON.stringify(some_array) 14 } 15 }).done(function(data) { 16 // the data is the returned slice 17 alert(data); 18 }).error(function(jqXHR, textStatus, errorThrown) { 19 alert(errorThrown); 20 }); 21 return false; 22 }); 23}); 24