• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Working with Arrays > Debugging and Troubleshooting Script Problems

Debugging and Troubleshooting Script Problems

Using prototype to Simulate the Netscape-Only Methods

The Array object has several Netscape methods. I'd like to use these methods, but the majority of my users run Internet Explorer.

Several of the Array object's methods—pop(), push(), shift(), splice(), and unshift()—have a very big drawback: They're not supported by any versions of Internet Explorer or by Netscape 3. However, it's possible to use the Array object's prototype property to add new functions to the Array object that perform the same tasks as these methods. If you provide these functions with the same names as the Netscape-only methods, your functions will override the methods and you'll be able to use them in any browser. The next few sections present functions that you can use in place of these Netscape-only methods.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint