Search results for 2013 11 25 writing better jquery code

Writing Better jQuery Code

by Matt Carella

for this Combine jQuery with Native JavaScript When Needed As I was saying before, jQuery is JavaScript, and this means that in jQuery we can do the same things…

Replacing jQuery with Vanilla JavaScript

by Brian Rinaldi

see how we’d set this up using jQuery. Setting Up a jQuery Toggle On its surface the jQuery implementation is very simple and straightforward. One of jQuery’s key strengths is…

Building a Parallax Scrolling Game with Pixi.js – Part 4

by Brian Rinaldi

…following at the end of your class: Walls.prototype.createTestSteppedWallSpan = function() { this.addSlice(SliceType.FRONT, 192); this.addSlice(SliceType.WINDOW, 192); this.addSlice(SliceType.DECORATION, 192); this.addSlice(SliceType.STEP, 256); this.addSlice(SliceType.WINDOW, 256); this.addSlice(SliceType.BACK, 256); }; Our stepped wall span is six…

Rethinking DOM Traversal

by Brian Rinaldi

…traversal. Wrapping Up Based upon my experiments using jQuery, plain JavaScript and HTML.js, here are my conclusions. jQuery still offers the easiest and cleanest API for DOM traversal…however, jQuery might…

5 Things You Should Stop Doing With jQuery

by Burke Holland

a document ready function and then just vomited up massive amounts of jQuery. Some of the worst jQuery code ever written was written by me – I can assure you…

Soma.js – Your Way Out of Chaotic JavaScript

by Brian Rinaldi

…re-usable components; Improved code maintenance; More testable components (mocking object); More readable code (reduction of boilerplate code). Dependency injection involves a way of thinking called the Hollywood principle “don’t call…

Is jQuery Too Big For Mobile?

by TJ VanToll

…Remember that we’re talking about jQuery, and there’s a simple way to avoid any additional latency costs when using jQuery: instead of placing jQuery and your app’s code in their…

Towards a More Modular Future for JavaScript Libraries

by Brian Rinaldi

you land on a blog post that contains 11 lines of magic code you can copy/paste. Copy/pasting code into your project may feel wrong, you think- perhaps it’d better to…

Building a Parallax Scrolling Game with Pixi.js – Part 2

by Brian Rinaldi

…it within our Far class. Start by removing the original code from index.html: var farTexture = PIXI.Texture.fromImage(“resources/bg-far.png”); far = new Far(farTexture, 512, 256); far.position.x = 0; far.position.y = 0; far.tilePosition.x…

Real-World Best Practices for Building Angular.js Apps without Browserify or Require.js

by Jeff Dickey

…// $ is jQuery since we added that script tag var jq = jQuery.noConflict(); // $ is back to ‘myobject that jquery will conflict with’ // jq is now jQuery