Fork me on GitHub

article

Seeking Book Suggestions

April 9, 2005 | Web Design & Development

So it seems that I’m gonna have to learn some javascript for work. Our eCommerce package is a proprietary piece of shit that runs on MAS and Providex and is the slow and has a very odd construct in the way is processes information.

Take for example is method of repeating a table row based on a template. The template contains code like this (greatly simplified to show only one item):

<!-- product info repeats here -->
<tr>
   <td>
       ~~IWAA_UT_UDF_IAA~~
   </td>
</tr>
<!-- end product info repeat -->

So by initially reviewing the template you’d think that the entire contents of what is inbetween the comments would be evaluated to replace the specific information. But it does not. For some reason the table row has to be there for the loop to work. So I can’t strip out the table and use CSS formatting in its place. The only way to get this info would be to grab it via javascript and reformat it. Simply the stupidest workaround I’ve ever seen. It looks like I’m gonna have to do this with the header and footer as well. Or so I’m told. I’ve made other edits to the templates in the table structure that haven’t broken the structure so I’m wondering if what I’ve been told is true or just the result of weary programmers not wanting to mess with the code too much. I’m gonna try and simply edit the looped code to see what happens. If it breaks is breaks, if not, I’m gonna be laughing up and down somebody’s face.

Either way, I really should know more about javascript so if anyone can recommend a good book I’d appreciate it very much.

11 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  • most of my knowledge came from google.com. it’s got the greatest resources you can ever have. 😛

    tom, April 9, 2005 8:23 pm | permalink

  • Right now, webmonkey is my friend.

    Shawn Parker, April 9, 2005 9:11 pm | permalink

  • O’Reilly’s books have pleased me.

    webmonkey’s tutorial is old and a bit out of date, but it’s good to get started.

    The script most likely crawls the page and is told to look for a <td> tag. In Javascript, most of the elements in a document are referenced in an array. For example, document.getElementsByTagName(‘td’) returns an array of all the <td>s in the document. Just as document.images[x] is an array of all the document’s images.

    So rather than searching the entire document for a given string, the script probably only searches certain locations for strings.

    Anyway, I’m enjoying and learning a lot from O’Reilly’s big fat reference book.

    John Pennypacker, April 9, 2005 10:37 pm | permalink

  • I almost bought that today at the Barney (read: Barnes & Noble) but I can get it cheap at SoftPro (a local techy book store).

    I’m noticing the WebMonkey tutorial mention that it might be time to upgrade from IE 3, so yeah, its a bit out of date. So far though everything has worked except for the window.status but that’s pretty trivial and really, who cares?!?

    As for the script I mentioned – going through and hitting all the TDs is how I’m gonna have to fix their crap. The script comes out of providex which, by my best guess, is a weird variant of Perl.

    Shawn Parker, April 9, 2005 11:16 pm | permalink

  • Heeeey. w3schools.com has a JS section. Neat!

    Shawn Parker, April 9, 2005 11:29 pm | permalink

  • Found this nice little reference as well: JavaScript Reference

    Shawn Parker, April 11, 2005 9:03 am | permalink

  • I started with webmonkey, then i got the webmonkey d00d’s book. But i think that’s not really what you’re looking for. It is great though. It’s called "The book of javascript" by Dave Thau

    tobobo, April 16, 2005 6:32 pm | permalink

  • I agree with John Pennypacker. O’Reilly’s books never disappointed me.

    tom, April 16, 2005 11:03 pm | permalink

  • tom is wise. 🙂

    John Pennypacker, April 17, 2005 8:07 am | permalink

  • Well, that is the book I ended up buying. We’ll see how it goes.

    Shawn Parker, April 17, 2005 10:23 pm | permalink

  • O’Reilly’s books whether it was small quick reference pocket books or the PHP CookBook, etc, all of them were detailed, fun, and informative.

    tom, April 18, 2005 12:16 am | permalink

Comments are closed