Tidying .js files JQuery code to toggle an edit form
Tidying js.js files
I usually find the .js files to be quite messy and the truth is that minesmine are even worse than the average as, being soft, I'mI'm not the sharpest tool neither at JqueryjQuery nor JavascriptJavaScript.
So I would really appreciate if someone could give me a heads up about improving the readability (and point me bad practices) of this code. Any comment will be highly appreciated as I would try to have them into account for other .js files.
Thanks!
Edit: By the way, I have seen http://stackoverflow.com/questions/14754619/jquery-ajax-success-callback-function-definitionhere that with deferred objects seems cleaner (apart of other considerations),. I couldn't make it work, though but maybe is the way?.
Tidying js files
I usually find the .js files to be quite messy and the truth is that mines are even worse than the average as, being soft, I'm not the sharpest tool neither at Jquery nor Javascript.
So I would really appreciate if someone could give me a heads up about improving the readability (and point me bad practices) of this code. Any comment will be highly appreciated as I would try to have them into account for other .js files
Thanks!
Edit: By the way, I have seen http://stackoverflow.com/questions/14754619/jquery-ajax-success-callback-function-definition that with deferred objects seems cleaner (apart of other considerations), couldn't make it work though but maybe is the way?
Tidying .js files
I usually find the .js files to be quite messy and the truth is that mine are even worse than the average as, being soft, I'm not the sharpest tool neither at jQuery nor JavaScript.
I would really appreciate if someone could give me a heads up about improving the readability (and point me bad practices) of this code. I would try to have them into account for other .js files.
By the way, I have seen here that deferred objects seems cleaner (apart of other considerations). I couldn't make it work, though.