jQuery ON (syntax difference from live)

Since jQuery live is marked as deprecated. I thought it’d be a good thing to switch to use jQuery on.

I was at first shocked to find out that “ON” did not work like “LIVE”. Without digging very far, I simply switched my old syntax that had

$('a.delete').live('click', function() {});

to

$('a.delete').on('click', function() {});

It worked for non dynamically generated DOM tree but failed to work on anything that’s dynamically generated. Thank you to stackoverflow, I was able to use the correct syntax for any bubbling event binding to

$(document).on('click', 'a.delete', function(event) {});

Here’s my jsFiddle example to better demonstrate what I’m talking about -> jQuery ON syntax vs. LIVE syntax.

Spring JdbcTemplate to get db function output

e.g. SQL

select myFunction(param1, param2) from dual

returns a String value.

Do this using Spring JdbcTemplate via:

String result = getJdbcTemplate().queryForObject(sql, 
	new Object[] {
		param1, param2
	},
	String.class
);

See any big issue doing it this way? I personally don’t. I assume Spring will throw a SQL exception if for any reason the function errs out?