Read more about the idea behind Testing Tours.
Tours
1.The Intellectual's Tour
2.The Landmark Tour
3.Preschooler's Tour
This afternoon I had the opportunity to do another lunch-and-learn presentation where I work. The goals for my presentation were to try and clear up a few areas in JavaScript found to be a bit confusing, show aspects of JavaScript people may be unaware of and to encourage people to give as much consideration to their JavaScript code as they do to their other application code. Finally, I wanted to do the presentation focusing on the language itself with as little use of the DOM and HTML as possible. If you are interested you can watch the javascript lunch and learn screencast. Any feedback you have on the presentation is more than welcome.
The inspiration for this presentation started to develop after I finished reading Pro JavaScript Design Patterns by Ross Harmes and Dustin Diaz. This book was an eye opener for me for a number of different reasons. After reading the book I realized there were a lot of different aspects of JavaScript I didn’t realize I didn’t know. I have been using JavaScript with the DOM for a number of years and thought I was proficient but I learned there was a lot more to JavaScript than I was aware of.
After finishing the Design Patterns book I looked for another book with a focus on the language itself (instead of involving the DOM) and found JavaScript: The Good Parts by Douglas Crockford. This book was exactly what I was looking for and helped clear up a lot of things I found confusing. After reading this book I realized other co-workers might be in the same boat as me and might be interested in finding out some of these things so I signed up for the lunch-and-learn.
As I was preparing for the presentation I came across a recommendation for Object-Oriented JavaScript by Stoyan Stefanov and found this to be an outstanding book (I actually wish I had started with this book). If you are looking to learn the fundamentals of JavaScript and want to get a strong understanding of the language I would recommend starting here. Even if you are confident with JavaScript I would recommend all three of these books because they contain a lot of good information.
Regex regexNo = new Regex("no.*", RegexOptions.IgnoreCase));
Regex regexYes = new Regex("yes.*", RegexOptions.IgnoreCase));
foreach (Div div in ActiveBrowser.Divs.Filter(Find.ByClass("message")))
{
ElementsContainer ec = (ElementsContainer)div;
if (cancel && ec.Link(Find.ByText(regexNo).Exists)
{
ec.Link(Find.ByText(regexNo).Click();
return;
}
else if (!(cancel) && (ec.Link(Find.ByText(regexYes).Exists))
{
ec.Link(Find.ByText(regexYes).Click();
return;
}
}