This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
1. a. var aField = myForm['aField']; b. var aField = myForm.document.getElementById('aField') what is the difference between the two ?
getElementnById is a DOM method to find an element by its id. Ids have to be sigular so you can not have more than one element on the page with that id. The other references the form object for a name, names can be repeated on a page! IE is bad and allows for name to be seached by getElementById, but no other browsers allow that. So do not do it! Just a warning!
var myElem = document.forms["name or index number"].elements["name or index number"] is the full way to reference an element with the form object array and element array.
2. Does JS string have same function as aString.trim() in java ? No, but you can add this to your funcitons and it adds the functionality to the string object:
3. Where can I find some mature JS utility package, just like jar component in Java ? Guess you are asking for a library? Look for prototype.js (Google should be first result)
Joined: Dec 23, 2003
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com