I am trying to translate this code from Prototype into the same thing in Jquery:
$("follow_form").update("<%= escape_javascript(render('users/unfollow')) %>")
$("followers").update('<%= "#{@user.followers.count} followers" %>')
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you’d want:
The Prototype “$” function is a short-cut to “document.getElementById()” (sort-of; it’s a little more complicated on IE). For jQuery, you have to use a CSS-like selector syntax. Then, the “.update()” function in Prototype is for accessing “innerHTML” with some extra cleanup behavior, and jQuery’s “.html()” is similar.