Closed brettveenstra closed 10 years ago
Hi @brettveenstra Good question let me see if there is an interface between Secure
and Init
for the .ready()
function.
@brettveenstra this is not available for PUBNUB.secure(...)
as you have noted. The best option is to move the PubNub javascript resources to the bottom of the <body>
. This option will provide the best performance for all browsers.
<script ...></script>
<script ...></script>
</body> <!-- Closing Body Tag -->
This method allows you to skip the .ready()
function altogether. It is much better to do this!
I will also file a ticket to expose it via secure as well. @brettveenstra does @stephenlb's workaround work for you, or you are stuck with PubNub scripts in the head?
@geremyCohen Definitely need support for it so can use this in head. Unfortunately cannot register them all in the body.
@geremyCohen can you add this? it is a single line addition to /core/crypto/encrypt-pubnub.js
here:
https://github.com/pubnub/javascript/blob/master/core/crypto/encrypt-pubnub.js#L34
And the change is simply exposing:
ready : pubnub.ready, // < --- ADD
raw_encrypt : encrypt,
raw_decrypt : decrypt,
...
@stephenlb @brettveenstra will do.
Adding now to master.
On 05/13/2013 07:48 PM, Stephen L. Blum wrote:
|ready: pubnub.ready,|
When initializing with
PUBNUB.secure()
call instead ofPUBNUB.init()
, the.ready()
function is not provided.Two questions:
.ready()
needed when including pubnub in<head>
? (I can't move it to last element in body for my solution.).secure()
to be a pure extension of whatinit()
creates?example code: