Perform action on logout, I would like to add javascript on logout. I tried using hook_user_logout but the javascript doesn't get added. 

Even adding something as simple as drupal_set_message doesn't result in a message  being displayed. 

I know the hook is firing because I can add a watchdog message in the hook and see it in the logs. The watchdog message is about the only thing I tried that DID work.
Curious about other options that may or may not have results, I tried looking at Actions and Triggers and Rules. I basically decided to try to do something simple on logout, like add a message. But even those modules don't work! I was actually really suprised when Rules didn't work.

I can add messages and do actions elsewhere. Has anyone else had problems with hook_user_logout? And does anyone know if it is possible to add javascript with that hook?

Is this some sort of problem involving drupal_goto? Hmmm.
I am on the verge of just adding JQuery to every page to check every link to see if it is a logout link and then adding a click event. It will work for my purposes, but it is such a hack. I would prefer not to.
Even adding something as simple as drupal_set_message doesn't result in a message being displayed.


That's the  expected behaviour - in the logout hook, you're still inside the authenticated user's session. Once they're logged out, you're not any more. So messages intended for that user are no longer there, because that session has been destroyed.

You should implement a logout/token expiry resource in your API, and invoke that in the logout hook. Then you don't need to remove the token held in local storage, as it will not be valid any more.