More powerful jQuery getScript with cache control

If you love getScript as a shortcut method in jQuery, but you hate not being able to control whether the script calls from the browsers cache or not then you can override the built-in function with a new one which is backwards compatible, so it won’t break any of your old code, and allows you to choose true or false to caching.

Read the original post by Jamie Thompson (via Internet Archive)

(function($){
$.getScript = function(url, callback, cache){
	$.ajax({
			type: "GET",
			url: url,
			success: callback,
			dataType: "script",
			cache: cache
	});
};
})(jQuery)

[carousel keywords=”jquery” tag=”fetchit-21″]

Disable Select Options in Internet Explorer

Put your hands up if you hate developing for Internet explorer….

That would be most of you then.

I can’t stand its special ways of doing things, so when I find an easy work around it makes me happy.

The latest one I have had to find and put into practice is a method for disabling some Select dropdown options in a form. Internet explorer doesn’t support the disabled attribute on option elements. The following code will only work in standards complaint browsers (not in IE 6 or 7):

Continue reading

jCrop – jQuery’s Image Cropper

I have been doing a lot of javascript coding recently. It’s funny because until six months ago I was a javascript beginner. I had done some js but didn’t completely get it and began by copying and pasting from other sites in the hope that things would just work. Then again that’s how I started with php too.

As I began to work on PagePlay more and more the javascript needed to be more and more clean and easy to adapt for when we add new functionality.

Continue reading