开发者

Javascript show layer on page load

开发者 https://www.devze.com 2022-12-11 05:45 出处:网络
Getting an error when i use the following script to show a div when the page is loaded. <script type=\"text/javascript\">

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


You want

$("#friendslist").show()

instead of

$("#friendslist").Show()

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消