#[chrisbergr]The wp_login action fires after the user has successfully logged in. And then you'll get redirected, Maybe you'll see something if you add die(); after your echo statement. But this ist not the right place to deal with Javascript I guess...