Hi i have made a php function that has to be called from script tag since the value is generated from javascript. In short i have to execute php function dynamically in one page itself. The think i can achieve is that i can call a function with static parameters such as
$(".countryoptions").click(function(){
console.log($(this).val());
console.log(<?php echo json_encode(getRegions(NULL,NULL));?>);
console.log(<?php echo json_encode(getRegions(NULL,"$(this).val()"));?>);
});
The first two values are been printed as expected but the third makes me sad, values are been passed as string ("$(this).val()") itself not the value. It may be stupid but is there any way to encounter this problem without POST request.
Thanks in advance.