I have the following javascript code:
$(document).ready(function()
{
alert("test");
ajaxrequest();
});
function ajaxrequest()
{
alert("test");
$.ajax({
url:"/CRUD_LOGIN/php/getUserRank.php",
type: "GET",
dataType: 'json',
success:function(result){
alert(result);
if(result.rank == "A")
{
$("#bar").append("<li><a href='/CRUD_LOGIN/page/display.php'>Admin panel</a></li>");
}
}
});
}
but it isnt executed, and even the alerts are ignored... by the way, the getUserRank.php does this:
echo json_encode(array("rank" => "A"));