I could use some help initializing the javascript PubNub interface without having to append divs to the DOM before loading the .js library as recommended by https://pubnub-prod.appspot.com/account-javascript-api-include
I’d like to be able to init PubNub via a function. I tried modifying the solution suggested by this SO question without success: pubnub and head.js
Phil from PubNub here. We’ve got you covered. All you have to do is use the following code:
Hope this solves your problem.