views:

107

answers:

2

Getting an error when i use the following script to show a div when the page is loaded.

<script type="text/javascript">
$(document).ready(function() {
    $("#friendslist").Show();
});
</script>

It says $("#friendslist").Show() is not a function

+8  A: 

You want

$("#friendslist").show()

instead of

$("#friendslist").Show()

(note, lower case 's' in 'show')

Phil
+2  A: 

jQuery tends to use camelCase for it's function names (per accepted JavaScript best practices). As such, the first word of the function name would be lowercase with each subsequent word being Title case.

$("#friendslist").show();

will be what you're looking for. An example of a camelCase function would be:

$("#friendslist").setStyle("display: block;");

Which is probably what .show() is doing anyway.

foxxtrot