[eluser]Jose Dueñas[/eluser]
Hi,
I've a controller which inserts into a databse an user:
Code:
class Users extends Controller {
function insert_user()
{
$this->Usersmodel->insert("John Smith");
}
}
What I want to do is do that with jQuery, I've tried from the view:
Code:
$.ajax({url:"http://localhost/index.php/users/insert_user",
success: function() {
// Request has been successfully submitted
alert("Succeeded");
},
error: function() {
// An error occurred, do something about it
alert("Failed");
},
complete: function() {
// We're all done so do any cleaning up.
alert("Process has been done");
}
});
And I always getting "Failed". It's because I'm trying to load something is not a script.
How could I do this?
Thanks,
Jose