I'm trying to add:
drupal_add_js('jQuery(document).ready(function () { jQuery("input#edit-name").focus(); });', 'inline');
to the user login page when the user is not logged in. This lack of login form focus is one of my worst web annoyances.
What would be the most efficient way to do this?
I can add the code to every page by adding it to my theme's js, but this is inefficient.
In the theme's template.php I can use theme_preprocess_page()
and check for $variables['logged_in']
but how do I test for only the /user page?