Q:

Checking if user is already logged in to webs site

When a user enters my website, I want to redirect him to his page before the main page is fully loaded. My only problem is what jquery event should I use?
Right now is use $(document).ready, but this is silly as I have to wait for nothing if the user has already signed in.
So, what event do I need?

A:

You should use $(document).ready for code that relies on the DOM being loaded - that is any code that reads or manipulates objects on the page.
Anything else you can just include in the body of the page to execute without wrapping it in an event, provided any other dependency is loaded.
BUT, in your case - you want to redirect someone before the page is fully loaded - by far the best user experience here will be to do a server-side redirect to send the user through to their personalised page - don't even render the first page, and certainly don't use JavaScript to bounce them to a different page half way through a page load.

