First, thank you both try to help me on these issues.
Well done for small errors in my code.
I added the ";" at the end of javascript strings and i changed the code as :
@wnd_params.execute_script("$('#longueur').val(#{s_longueur.inspect});") to escape ' and " characters
I don't have a Mac at hand either. I have to wait for a Mac user have the time to try my corrections and then give me the result.