I’m getting a error message that says missing ) after argument list and not sure why.
function getInboxUnreadMessagesCount(displayElementID)
{
$.get(<?php echo base_url(); ?>'dashboard/getInboxUnreadMessagesCount', function(data)
{
$messageCountJSON = data;
if(displayElementID != null && displayElementID != undefined && displayElementID != '')
{
//$('#'+displayElementID).html($messageCountJSON);
if(parseInt($('#'+displayElementID).text()) < parseInt($messageCountJSON))
{
$.jGrowl("You have received a new private message!", {theme : 'information'});
$('#'+displayElementID).html($messageCountJSON).css({"display":"block"});
}
if(parseInt($messageCountJSON) == 0)
{
$('#'+displayElementID).html($messageCountJSON).css({"display":"none"});
}
}
}, 'json');
}
Any thoughts on why this is?
What does
<?php echo base_url(); ?>output, exactly? I presume just a bare string, so you’ll end up with code like:Clearly that won’t work. You probably want:
This way the base url will end up actually inside the path to
$.get.