I don’t know is it possible – to call jQuery when user sign up.
I’m using Rails and Devise gem, so I have after_sign_up_path:
def after_sign_up_path_for(resource)
edit_user_registration_path(current_user)
//call jQuery
end
or if this is impossible – why my js is not working :
if($('.alert').val()=='Welcome! You have signed up successfully.'))
$('#congrats').show();
EDIT: HTML
<div class="alert alert-notice">Welcome! You have signed up successfully.</div>
There is an extra
)in your code:Try this:
for div elements you should use
text()instead ofval():