jquery >= 1.10 

I got "Maximum call stack exceeded".
So I changed the code. It seems to work for me.