I think Ben was right about that being called at a wrong place.
i was able to have the ajax response by doing the following.
I place the add_action and the function to be called within a plugin php.
it looks like to me. it works perfect with the codes above IF and ONLY IF I don’t use include. meaning if i don’t have the plugin load the php file when processing the ajax call.
this is very wired.
why it works only when i have include the php file under the plugin but when i use the same code. which is include ‘ajax_res.php’; it will never work when under shortcode function.
so in short. is it impossible to register ajax function and have that function called if we use include to load the php file within shortcode.
this symptom is just really wired. somewhere alone the code. there must be something not called.