Hey all,
I am developing a plugin, where I wanna ask my personal web API about
some email details.
First, I tried to make a jquery ajax request.
Firebug shows me the correct response, but I always get a 404 error. So
the plugin does not get the result.
I can imagine that is because a cross domain issue.
Then I tried to do an ajax request to my server side plugin code, where
I would try to make a php request to my API. But to be honest, I can't
figure out how to send my values with such a GET request, process them
within the php function and send it back.
Of course, I have read the documentation. I also analysed some other
plugins, but it is still just random guessing for me.
Thanks for any help.
Cheers,
Jack
In my JavaScript I do:
var value = "test"
rcmail.http_get("plugin.someaction","value"+value);
In my php I do:
$this->register_action('plugin.someaction', array($this, 'actions'));
and
function actions($args)
{
echo '<script type="text/javascript">alert("' . $args .
'")</script>';
echo '<script type="text/javascript">alert("' . $args['value'] .
'")</script>';
$this->rc->ouput->send();
}