I am trying to get data from another page, but can't pass this data using this code.
$("#doctorAddModalBtn").on('click', function()
{
alert(RandomCode());
});
function RandomCode()
{
pageLink = 'RandomCodeGenerate.php';
$.get(pageLink, function(result){
return result;
});
}