最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Why firebug shows some javascript objects in red color? - Stack Overflow

programmeradmin3浏览0评论

I am trying to learn and improve my javascript skills.

A very helpful tool is firebug, with which i can inspect different javascript objects.

However, i have some questions:

  1. Some object names (like jQuery, $, fn etc.) are displayed in red color. Why?

  2. Some other objects has a "prototype" property, which is not in bold. What is that and when is good or not to use/implement it?

  3. Most of functions are shown as "function()". But there are also some other functions which are displayed, for example, as "u(M)", "z()", "B(E)". Why they are different?

Thank you

I am trying to learn and improve my javascript skills.

A very helpful tool is firebug, with which i can inspect different javascript objects.

However, i have some questions:

  1. Some object names (like jQuery, $, fn etc.) are displayed in red color. Why?

  2. Some other objects has a "prototype" property, which is not in bold. What is that and when is good or not to use/implement it?

  3. Most of functions are shown as "function()". But there are also some other functions which are displayed, for example, as "u(M)", "z()", "B(E)". Why they are different?

Thank you

Share Improve this question edited Jan 20, 2012 at 9:09 Catalin asked Jan 20, 2012 at 8:22 CatalinCatalin 11.7k19 gold badges80 silver badges152 bronze badges 1
  • Please, add images to your post. – c69 Commented Jan 20, 2012 at 8:55
Add a ment  | 

3 Answers 3

Reset to default 8

from the documentation page of firebug:

Different color codes let you distinguish between the different types of variables and improve readability. Here they are in detail:

Format        Description
Bold Black    Objects
Black         DOM objects
get in gray   "Getter" functions
Bold green    User functions
Green         DOM functions
Bold Red      Constructor functions 

Hope this helps

You may want to have a look at the FirebugWiki

 Bold Red are constructor functions 

The 'prototype' property is a built-in feature that links to the structure of the object. In JS everything is an object, even functions, and by accessing the prototype property you can extend the object.

How does JavaScript .prototype work?

发布评论

评论列表(0)

  1. 暂无评论