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

Where can I find a list of all methods of javascript objects? - Stack Overflow

programmeradmin1浏览0评论

I just learned that alert() is a method of the window object. I also just learned that getElementById() is a method of the document object.

Is there a place where I can find documentation as to what methods belong to certain objects?

I just learned that alert() is a method of the window object. I also just learned that getElementById() is a method of the document object.

Is there a place where I can find documentation as to what methods belong to certain objects?

Share Improve this question asked Jan 29, 2012 at 20:50 user784637user784637 16.2k33 gold badges96 silver badges159 bronze badges 1
  • 4 developer.mozilla/en-US/docs – malletjo Commented Jan 29, 2012 at 20:53
Add a ment  | 

3 Answers 3

Reset to default 4

Try the Mozilla Developer Network documentation. It's quite good.

For example, you can find documentation on the both window object and the document.getElementById() method.

For a quick sandbox to try stuff out, you could try jsFiddle, or even just the JS console in Google Chrome (ctrl+shift+j).

for any object, like window for example, you can do something like:

for(var prop in window){
   console.log(prop);
   console.debug(window[prop]);
}

log will tell you the name of the property and debug will show you the details

Try this place http://krook/jsdom/

Also: I'd suggest downloading Firebug addon for firefox. Use the DOM tab and you'll be able to browse which methods live where in the browser.

发布评论

评论列表(0)

  1. 暂无评论