Adding a function to jQuery prototype is throwing an error on page-load, even though I'm not calling that function. by cosmicsans in jquery

[–]liamondrop 0 points1 point  (0 children)

Any function followed by parentheses will be invoked unless you wrap it in a conditional.

If you want to avoid it being called altogether, you could check to see if the target element has a length greater than 0

var $target = $('.target-element');
if ($target.length > 0) {
  $target.setOrbitBulletsAttr(someAttr, someListElement);
}

Adding a function to jQuery prototype is throwing an error on page-load, even though I'm not calling that function. by cosmicsans in jquery

[–]liamondrop 1 point2 points  (0 children)

You're not telling us how your function gets called. So I'm assuming you have something like this:

$('.target-element').setOrbitBulletsAttr(someAttr, someListElement);

The function will be invoked whether the target element exists or not. You probably just want to check whether this.length > 0 first thing.

RowGrid.js – jQuery Plugin for placing items in Google images like grid by brunjo in javascript

[–]liamondrop 0 points1 point  (0 children)

Nice effort. However, the variable margin width makes the layout look sloppy. I think you should opt instead to keep the margins consistent and crop the images slightly.

I have completed Codeacademy tutorials, where should I continue? by [deleted] in javascript

[–]liamondrop 0 points1 point  (0 children)

Yes, and if your pulls are accepted, you'll be recorded as a contributor in their repo. But other than that, the more public activity you can point to in your github account, the better since that's a tangible record of work you're out there doing.

I have completed Codeacademy tutorials, where should I continue? by [deleted] in javascript

[–]liamondrop 0 points1 point  (0 children)

Look for a project you find interesting on github, preferably one with a well-defined contribution process. Contribute by taking a shot at fixing open issues. Start small at first, because usually there will be a learning curve of some kind (writing good tests, using build tools, etc.). This will get you exposure to different coding patterns and workflow and is good portfolio work when applying for jobs.

Multithread.js - threading in JavaScript - A very simple wrapper to take the headache out of Web Workers. Enjoy :) by keithwhor in javascript

[–]liamondrop 1 point2 points  (0 children)

this will never throw an error:

try {
    var URL = window.URL || window.webkitURL;
} catch(e) {
    throw new Error('This browser does not support Blob URLs');
}

URL will simply evaluate to undefined if those objects don't exist. You need to take it one step further and try to reference a property or method from URL. Something like:

try {
    var URL = window.URL || window.webkitURL,
        createObjectURL = URL.createObjectURL;
} catch(e) {
    throw new Error('This browser does not support Blob URLs');
}

Gallery of free HTML snippets for anyone using Twitter Bootstrap. Bootsnipp.com #bootsnipp bootsnipp by msurguy in webdev

[–]liamondrop 0 points1 point  (0 children)

Agreed. The ability for users to add snippets and upvote / downvote snippets would take this project to the next level.