I've had this problem repeatedly with RJS, and I'm not saying it's not something that I'm doing... in fact, if I had to take a bet on whether the problem is in my code or the RJS code, I'd bet it's my code. :)
Never the less, I've seen several pages online where this has been an issue for other people and it keeps coming back to haunt me, so here's my fix.
When you're using RJS to do JavaScript magic and you add something simple like
page.replace "main", :partial => "update_student"
and the JavaScript just shows up on the page you're trying to update, then you've found this issue. You see something like this in the browser: