1

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

Community
  • 1
  • 1
Makita
  • 1,812
  • 12
  • 15

1 Answers1

0

Phil from PubNub here. We've got you covered. All you have to do is use the following code:

var pubnub = PUBNUB.init({
    publish_key   : my_publish_key,
    subscribe_key : my_subscribe_key,
    ssl           : false,
    origin        : 'pubsub.pubnub.com'
});

Hope this solves your problem.

Phil Deschaine
  • 491
  • 3
  • 5