I have the following script inside my master page :-
<script type= "application/javascript">
document.getElementById("currentdate").innerHTML = EMBEDformatAMPM();
var myVar=setInterval(function(){myTimer()},30000);
function myTimer()
{
document.getElementById("currentdate").innerHTML = EMBEDformatAMPM();
}
//code goes here
}</script>
but the problem i am facing is that the script will run before the (currentdate").innerHTML loads, and the script will raise a null reference exception, so my question is basically about how i can force the javaScript to run after the page loads.?
Thanks
EDIT
My jQuery file is raising the following error ,, not sure why :-
Error: Syntax error, unrecognized expression: unsupported pseudo: visited

("currentdate").innerHTMLloads?" Are you referring to the rendering of the element?</body, you don't need to register your code to anyonloadevent.:visitedpseudo selector isn't supported. (Don't ask me why). Use the jquery.visited plugin. remysharp.com/2008/02/25/visited-plugin