JavaScript: Difference between revisions

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Notes: issues with FFox DOM
debugging tools; minor update
Line 1: Line 1:
[[Computing]]: [[Software]]: [[Programming]]: [[JavaScript]]{{seed}}
[[Computing]]: [[Software]]: [[Programming]]: [[JavaScript]]{{seed}}
==Notes==
==Notes==
In order to use JavaScript to control a web browser, you need to know about the Document Object Model (DOM) of that browser. Most modern browsers conform at least loosely to a standard DOM, but it is always a good idea to test the particular functions you are using in a variety of browsers. (Pre-packaged code is often written to automatically detect browser type/version and use the appropriate identifiers.)
In order to use JavaScript to control a web browser, you need to know about the [[Document Object Model]] (DOM) of that browser. Most modern browsers conform at least loosely to a standard DOM, but it is always a good idea to test the particular functions you are using in a variety of browsers. (Pre-packaged code is often written to automatically detect browser type/version and use the appropriate identifiers.)
 
* '''Debugging tools''': [http://jslint.com/ JSLint], <angular/>, JSTestDriver, jstest, and SinonJS
==Issues==
==Issues==
FireFox's DOM appears to have a couple of bugs which only show up in Linux:
As of 2006, [[FireFox]]'s DOM appeared to have a couple of bugs which only show up in [[Linux]]:
* Popup windows cannot be made to be "always on top" (window.open() with parameter "dependent=1")
* Popup windows cannot be made to be "always on top" (window.open() with parameter "dependent=1")
* The onblur event is triggered by moving or resizing the window, as well as when the window loses focus
* The onblur event is triggered by moving or resizing the window, as well as when the window loses focus


These bugs have probably been fixed in the intervening 6 years, but I haven't tested them since then.
==Links==
==Links==
* [http://developer.mozilla.org/en/docs/JavaScript Mozilla developer center]: JS reference, guide, related info
* [http://developer.mozilla.org/en/docs/JavaScript Mozilla developer center]: JS reference, guide, related info
* '''Document Object Model''':
* '''Document Object Model''':
** [http://developer.mozilla.org/en/docs/DOM Mozilla developer center]: Gecko DOM reference, related info
** [http://developer.mozilla.org/en/docs/DOM Mozilla developer center]: Gecko DOM reference, related info

Revision as of 02:55, 14 February 2012

Computing: Software: Programming: JavaScript<hide>

 page status::seed

</hide>

This page is a seed article. You can help HTYP water it: make a request to expand a given page and/or donate to help give us more writing-hours!

Notes

In order to use JavaScript to control a web browser, you need to know about the Document Object Model (DOM) of that browser. Most modern browsers conform at least loosely to a standard DOM, but it is always a good idea to test the particular functions you are using in a variety of browsers. (Pre-packaged code is often written to automatically detect browser type/version and use the appropriate identifiers.)

  • Debugging tools: JSLint, <angular/>, JSTestDriver, jstest, and SinonJS

Issues

As of 2006, FireFox's DOM appeared to have a couple of bugs which only show up in Linux:

  • Popup windows cannot be made to be "always on top" (window.open() with parameter "dependent=1")
  • The onblur event is triggered by moving or resizing the window, as well as when the window loses focus

These bugs have probably been fixed in the intervening 6 years, but I haven't tested them since then.