diff --git a/examples/js-sdk/views/index.html b/examples/js-sdk/views/index.html index dc4cc9f4..b252118d 100644 --- a/examples/js-sdk/views/index.html +++ b/examples/js-sdk/views/index.html @@ -12,18 +12,18 @@ let callbackCounter = 0; function updateGuiElements(state) { - $("#targeted_advertising_ready").html(__uid2.getAdvertisingToken() ? "yes" : "no"); - $("#advertising_token").html(String(__uid2.getAdvertisingToken())); - $("#login_required").html(__uid2.isLoginRequired() ? "yes" : "no"); - $("#update_counter").html(callbackCounter); - $("#identity_state").html(String(JSON.stringify(state, null, 2))); + $('#targeted_advertising_ready').html(__uid2.getAdvertisingToken() ? 'yes' : 'no'); + $('#advertising_token').html(String(__uid2.getAdvertisingToken())); + $('#login_required').html(__uid2.isLoginRequired() ? 'yes' : 'no'); + $('#update_counter').html(callbackCounter); + $('#identity_state').html(String(JSON.stringify(state, null, 2))); if (__uid2.isLoginRequired()) { - $("#login_form").show(); - $("#logout_form").hide(); + $('#login_form').show(); + $('#logout_form').hide(); } else { - $("#login_form").hide(); - $("#logout_form").show(); + $('#login_form').hide(); + $('#logout_form').show(); } } @@ -32,7 +32,7 @@ updateGuiElements(state); } - $("#logout").click(() => { + $('#logout').click(() => { __uid2.disconnect(); updateGuiElements(undefined); }); @@ -40,8 +40,9 @@ updateGuiElements(undefined); __uid2.init({ - baseUrl: "<%- uid2BaseUrl %>" + baseUrl: '<%- uid2BaseUrl %>', }); + __uid2.callbacks.push(onUid2IdentityUpdated); }); @@ -49,18 +50,45 @@ <%- include('intro.html'); -%> - - - - - + + + + + + + + + + + + + + + + + + + +
Ready for Targeted Advertising:
UID2 Advertising Token:
Is UID2 Login Required?
UID2 Identity Updated Counter:
UID2 Identity Callback State:
Ready for Targeted Advertising:
UID2 Advertising Token:
Is UID2 Login Required?
UID2 Identity Updated Counter:
UID2 Identity Callback State:
- - + +