How to add a javascript file or javascript code if the user is logged in to the website?
The website is built with drupal 7.
Try the following code:
global $user;
if($user->uid != 0)
{
drupal_add_js("PATH_TO_JS_FILE");
}
Hope this helps... Muhammad.