$.getJSON('http://www.thesite.net/api.php', function(data) {
if (data.status != 401)
{
if (data.messages == 0)
{
$('#messages').html('No New Messages');
}
else
{
$('#messages').html(data.messages + ' new messages. <a href="javascript:go_to_messages();">Check</a>');
}
$('#currency').html(data.cashfmt + ' Bux');
}
else
{
$('#container').html('You are not logged into the site. Please <a href="javascript:go_to_login();">login</a>.');
}
});
This is the code that I have with a few small modifications. It is surrounded by the tags in an HTML document. It is to be used in an extension. It works perfectly in Chrome when I make the extension and use it but in the same document in Opera, and I have checked multiple times, this is the cause of the problem. The page remains unedited after it runs. The rest of the page is very simply, with very little JS. There are no Chrome-specific methods. For some reason this isn't working in Opera. I tried adding a line to check if maybe it was just ignoring the ifs, but I found that it even ignores lines placed after the first line(It worked perfectly in Chrome when I did this) Does Opera not accept getJSON?