How do I use the subscribe method in PubNub's javaScript library?

Receiving a message (aka subscribing to a channel) in HTML (via JavaScript) can be accomplished this way. ~~~ ~~~