Simple jquery question, mostly a syntax thing I think

Associate
Joined
20 May 2007
Posts
441
Hey everyone

This is pretty simple thing and I know Im being a little bit uptight about how to go about this as I know one method that works, but I was hoping to do it my way :D but im new to jquery so for all I know it may not be possible.

Anyway this is the code I know that works

Code:
<script type="text/javascript">
    $(document).ready(
        function()
	{
	    $("#Prof").hide();
	}
    );
</script>

however I was kind of hoping to achieve this by doing the following

Code:
<script type="text/javascript">
    $(document).ready(
        initPage()
    );
	
    function initPage()
    {
        $("#Prof").hide();
    }
</script>

Is this possible or am I being stupid wanting to achieve this, this way?

Cheers
Matt
 
Fixed it lol

Spent quite awhile on this and then before you know it I mucked around and found the fix lol

Code:
<script type="text/javascript">
	$(document).ready(
		function()
		{
			initPage();
		}
		);
	
	function initPage()
	{
		$("#debbyFullProf").hide();
	}
	</script>
 
Back
Top Bottom