.prop() vs .attr()

So jQuery 1.6 has the new function prop().

or in this case do they do the same thing? And if I do have to switch to using prop(), all the old attr() calls will break if i switch to […]

JavaScript closure inside loops – simple practical example

It outputs this: My value: 3 My value: 3 My value: 3 Whereas I’d like it to output: My value: 0 My value: 1 My value: 2 The same problem occurs when the delay in running the function is […]

Is there an “exists” function for jQuery?

How can I check the existence of an element in jQuery? The current code that I have is this:

Is there a more elegant way to approach this? Perhaps a plugin or a function? Yes!

This is in […]

Encode URL in JavaScript?

How do you safely encode a URL using JavaScript such that it can be put into a GET string?

I assume that you need to encode the myUrl variable on that second line? Check out the built-in function encodeURIComponent(str) […]