
Web Inspector: Understanding Stack Traces Posted by Yury Semikhatsky on Wednesday, April 20th, 2011 at 7:32 am Finding errors in JavaScript code both during application development and when it’s already released is an important part of web development. We’ve recently added a mechanism for handling uncaught JavaScript exceptions and made some improvements in the tools that allow you to work with stack traces. Now it’s a good time to summarize the ways one can deal with exceptions and stack traces in WebKit. Tracking exceptions When something goes wrong, you open the Web Inspector console (Ctrl+Shift+J / Cmd+Option+J) and find a number of JavaScript error messages there. However, there might be several execution paths that lead to the error and it’s not always obvious which one of them has happened. You may also want to pause JavaScript execution next time exception is thrown and inspect its call stack, scope variables and state of your app. Printing stack traces Handling exceptions at runtime using window.onerror
DOM Enlightenment - Exploring the relationship between JavaScript and the modern HTML DOM A Plugin Development Pattern I've been developing jQuery plugins for quite a while now, and I've become rather comfortable with a particular style of plugin development for my scripts. This article is meant to share the pattern that I've found especially useful for plugin authoring. It assumes you already have an understanding of plugin development for jQuery; if you're a novice plugin author, please review the jQuery Authoring Guidelines first. There are a few requirements that I feel this pattern handles nicely: Claim only a single name in the jQuery namespace Accept an options argument to control plugin behavior Provide public access to default plugin settings Provide public access to secondary functions (as applicable) Keep private functions private Support the Metadata Plugin I'll cover these requirements one by one, and as we work through them we'll build a simple plugin which highlights text. Claim only a single name in the jQuery namespace This implies a single-plugin script. JavaScript: Putting it All Together
How to Create Your First Web Page Note: If you know anything at all about HTML and CSS, don’t bother reading this, it’s a guide for the uninitiated, technophobes, luddites, computer-illiterates, anyone who is more comfortable with a pen and paper than a keyboard and mouse. If making a web page seems like brain surgery to you, then this is the article for you. What you need to know The only prior knowledge I will assume is that you’ve used a computer before, you’re familiar with using a keyboard and a word processor, and you’ve at least seen a website. Other than that, I assume you are completely ignorant! The Basics When you visit a website (for example the one you’re reading now), you see a page in your web browser (the program you use to access the internet) , containing text, images and maybe some other things like videos, music etc. In order to display a page correctly, the web browser needs to know about the structure of the page, e.g. What HTML Looks Like HTML uses ‘tags’ to identify different parts of a page.
What to Read to Get Up to Speed in JavaScript There’s a discussion going on on the JSMentors JavaScript mailing list about books to read to get you to the next level . There’s been a lot of great feedback and suggestions thrown out and I wanted to offer up what I felt were good to carry you through the learning process. While I list a number of books in the Big List page that I created , narrowing it down into specific levels makes a lot of sense. Note that some resources will overlap between levels. These are books that I’ve read over the years and found incredibly useful so I’m categorizing them to make it easier for you to get going. Introductory These are books that will give you the fundamentals of the JavaScript language and get you started: JavaScript: The Good Parts Professional JavaScript for Web Developers (Wrox Programmer to Programmer) ppk on JavaScript, 1/e Beginning JavaScript with DOM Scripting and Ajax: From Novice to Professional (Beginning: from Novice to Professional) Eloquent JavaScript (Online Resource) Intermediate
Programming JavaScript Applications Copyright © 2014 Eric Elliott Printed in the United States of America. O’Reilly books may be purchased for educational, business, or sales promotional use. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. Signs of a poorly written jQuery plugin So far with every single workshop I’ve given, both for advanced JavaScript and jQuery for Designers, this question (or some variation thereof) has come up: How do you know if the plugin is good to use? It’s always dependant on the problem they’re trying to solve, but in lieu of a better jQuery plugin ranking system, here’s a couple of tips that should raise a red flag. Consider the following: $.fn.myplugin = function () { var me = $(this).each(function() { return $(this).bind('someEvent', function () { // does something }); }); return me;}; Although the code may be perfect once some event has run, most times you don’t have time to read through all the code carefully and you need to make a decision so you can move on to the actual problem you’re trying to solve. In the code above, there’s a number of red flags that have gone up for me, and I tend to look in this area of code first. The inline return $.fn.myplugin = function () { var me = $(this).each(fn); return me;}; Should be written as:
30 Must See Web Generator for Lazy Webmasters Here’s a list of 70 hand-picked, easy to use, and free web generators that will save you tons of time and energy. I have grouped these tools into 10 categories: Color Palettes, Robots.txt, Website Screenshots, Favicons, Web Backgrounds, Webpage Elements (buttons, tabs, etc), Memes, Forms, Logos, and Dummy Texts. The best part about these tools is that they are completely free (some need you to signup though). Category #1: Color Palettes Generator Functions/Details: To generate color palettes based on image input.Allow users to compare, review, and select color combination at ease. Palette Generator Palette Generator – click image to visit online. Pictaculous Pictaculous – click image to visit online. Kuler Kuler – click image to visit online. Kuler is a cloud-based application for making color themes using an iPhone or your browser. Other Alternatives A few other not-to-miss color tools are Color Hunter, Colour Lovers, CSS Drive Colors Palette Generator, Color Scheme Designer, as well as Colrd.
The Complete Javascript Number Reference Filed: Mon, Apr 30 2007 under Programming|| Tags: reference javascript numbers number math Javascript is not a typed language so it should come as no surprise that there are no specific integer or floating-point types, no short, long, byte, double, or any other type other languages use to define numbers. All numbers in Javascript are 64bit (8 bytes) floating point numbers which yields an effective range of 5e-324 (negative) to 1.7976931348623157e+308 (positive). This reference will cover Javascript numeric literals and objects as well as the default Javascript Operators which manipulate those numbers. Precision All numbers in Javascript are 64bit (8 bytes) floating point numbers which yields an effective range of 5e-324 (negative) to 1.7976931348623157e+308 (positive) at the time this article was written (this may eventually change to 128 bits in the future as 64 bit processors become commonplace and the ECMA standards evolve). To Infinity And Beyond Octal and Hexadecimal Numbers Sources
The Problem with Native JavaScript APIs Copyright © 2012 O’Reilly Media Printed in the United States of America. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles ( For more information, contact our corporate/institutional sales department: 800-998-9938 or <corporate@oreilly.com>. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
Home | The Anti-IF Campaign