Lots of options here.
For a pure JS solution, have your page submit to itself, but with additional URL parameter (mypage.html?postback=true) - you can then get the page url with window.location.href, and parse that using a split or regex to look for your variable.
The much easier one, assuming you sending back to some sort of scripting language to proces the page (php/perl/asp/cf et. al), is to have them echo a line of javascript in the page setting a variable:
<html>
<?php
if ($_POST['myVar']) {
//postback
echo '<script>var postingBack = true;</script>';
//Do other processing
} else {
echo '<script>var postingBack = false;</script>'
} ?>
<script>
function myLoader() {
if (postingBack == false) {
//Do stuff
}
}
<body onLoad="myLoader():"> ...