I have this php and js file
PHP
<?php
$user_id = '10';
echo $user_id;
?>
JS
$(document).ready(function() {
$.ajax({
url:"uid.php",
success:function(data){
alert(data);
}
});
});
I get "10" as alert
However for this PHP and JS there is no alert
PHP
<?php
class uidclass{
function uid_func($event, $arguments)
{
$user_id = '10';
echo $user_id;
}
}
?>
JS
$(document).ready(function() {
$.ajax({
url:"uid.php",
success:function(data){
alert(data);
}
});
});
Thanks in advance