• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Want to be assured of Javascript best practices

 
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We here do not do an awful lot of Javascript coding. We took a short course on Ajax and leaned some JSON. Combining this with a short course on CSS, and our proverbial heads started spinning.

Before this we were just using Javascript for page validation and not really sure if the way we were using it was best practices.

After our short courses, we're probably more confused than before, but with enough options to each shoot ourselves in every toe on each foot.

This sounds like a book that could really help us, based on the write up on Amazon. But one question ... will this show us how to do stuff most straightforwardly using Javascript w/o additional libraries, or with them, primarily? Regards,
 
Author
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Bill,

The book's approach is, well, pragmatic. Nowaways, in the browser space, there still exist enough quirks and cross-compatibility issues that any nontrivial task requires adaptation and therefore should lean on frameworks. I do mean "middle-ground" frameworks such as jQuery or Prototype, not necessarily full-fledged "SDKs" such as YUI, Dojo or Ext.

The book starts by covering the fundamental "building blocks" of any in-browser scripting, mostly around data manipulation, DOM tweaking, and event handling. All of this is presented as pure JS, pure DOM, and when applicable illustrated across all major frameworks.

Then it goes on with actual tasks (including three grades of form validation, btw) and does rely on frameworks for this. As a Prototype Core member, all other things being equal, I went with Prototype when other frameworks had no clear edge for the task at hand. The only task for which I went with jQuery is the lightbox task, as I deem FancyBox one of the best libs out there, and it's jQuery-based.

However, all tasks have a simple enough code that is easily translatable to other frameworks. In face, the source code is on Github, available for anyone to fork and adapt to other frameworks. There's a jQuery fork ready for people to tap in (I unfortunately can't find the time).

'HTH
 
Bill Johnston
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Christophe,

Appreciate your reply. Yes what I am most hopeful for is a "best approach" in plain JS code first, frameworks added later so as to compare, learn and appreciate the benefits of FWs.
 
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic