[eluser]jblack199[/eluser]
Code:
$(document).ready(function() {
$('#submit_button').click (function () {
var item = $('#item').val();
$.post("/demo/processs", { 'item' : item },
function (data) {
alert(data.result);
}, "json");
});
});
then in controller demo.php you would need a function 'process'
Code:
function process() {
$item = trim($this->input->post('item'));
$array = array('result' => $item);
echo json_encode($array);
}
note: just wrote this up, havent tested the code.. beware!