2014-05-14, 11:54 AM
Hello!
I'm trying to use some simple Javascript in a page I'm creating using the Page Manager plugin. It works fine in a testing environment (Brackets running live preview via Xampp apache/sql), but live on my site none of the Javascript is working. Here's a snippet:
There's an window.onload trigger to update cell colors at load, and then an onclick event to trigger the updateAtma() function:
Like I mentioned, it works great testing it on my local server, but live it just doesn't even seem to recognize my script at all. Any help would be appreciated, thanks!
I'm trying to use some simple Javascript in a page I'm creating using the Page Manager plugin. It works fine in a testing environment (Brackets running live preview via Xampp apache/sql), but live on my site none of the Javascript is working. Here's a snippet:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
function updateAtma(atma, uid) {
$.post("functions/updateAtma.php", { 'atma': atma, 'uid': uid },
function(result) {
if(result == 1) {
document.getElementById(atma).style.backgroundColor = "#DDD";
} else {
document.getElementById(atma).style.backgroundColor = "#FFF";
}
});
}
function checkAtma(uid) {
alert("Test");
var i = 1;
while ( i < 13 ) {
var atma = "atma" + i;
$.post("functions/checkAtma.php", { 'atma': atma, 'uid': uid },
function(result) {
if(result == 1) {
document.getElementById(atma).style.backgroundColor = "#DDD";
} else {
document.getElementById(atma).style.backgroundColor = "#FFF";
}
});
i++;
}
}
window.onload = checkAtma($mybb->user['uid']);
</script>
There's an window.onload trigger to update cell colors at load, and then an onclick event to trigger the updateAtma() function:
<td id="atma1" class="trow1 atma_row" onclick="updateAtma('atma1', $mybb->user['uid'])">
Like I mentioned, it works great testing it on my local server, but live it just doesn't even seem to recognize my script at all. Any help would be appreciated, thanks!