This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

im.ping2964
im.ping2964

According to the third example in this document page. Thing works fine without parameter. But when I try to send some parameter along, I always got this message

Missing argument 1

Here is my Javascript:

$(this).request('onGetItemInfo',{data:{value:555}});

And this is my AJAX handler:

function onGetItemInfo($value)
{
    return 'somedata';
}

Tried digging around for examples and into "modules/cms/classes/Controller.php", but can't find any clues.

Last updated

d.negativa
d.negativa

All that you submit, are in the array $ _POST!
There is no need to specify an argument in a function in your controller


function onGetItemInfo()
{
    return post('data');
}

Last updated

im.ping2964
im.ping2964

Thank you d.negativa now it work without specify any argument and using

    return post('value')

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.