[eluser]stormbytes[/eluser]
This should have taken all of 5 minutes, but alas....
I'm trying to make a simple jQuery ajax call using $.get() and pass some params to the receiving CI function:
Here's the controller's method:
Code:
// Tried this first
public function test($foo)
{
$this->firephp->log($foo, 'GET Arr');
if( ! $foo)
{
echo 0;
}
else
{
$stack = json_decode($foo);
echo 'GET success: ' .$stack->stack_id;
}
}
// Then I tried this...
public function test()
{
$foo = $this->input->get('', TRUE);
$this->firephp->log($foo, 'GET Arr');
if( ! $foo)
{
echo 0;
}
else
{
$stack = json_decode($foo);
echo 'GET success: ' .$stack->stack_id;
}
}
Both times I'm getting 'FALSE' for GET. That is, no data is being received....
Here's the jQuery code:
Code:
$.get('http://sandbox/ajax/test', {'foo':'bar'}, function(data) {
alert(data);
});
Is there some bug or setting I'm unaware of? Mind boggling...