I'm currently building a website in which I'm using Javascript and jQuery for the first time. In my header I've got a script with a couple functions, and depending on what the user wants and the url he loads, I show some html in the body. Since part of that html needs updating I need to call one of the functions I made in my Javascript, so I currently try to do it like this:
<br />
<script type="text/javascript">
$(document).ready(function(){
updateMyDiv();
});
</script>
Unfortunately, it doesn't seem to work when I call this function which I define in the script in my header from within this snippet in my body. So I wonder: how do I call the updateMyDiv() function?