Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask SDKName undefined #13

Closed
appzone opened this issue Jul 11, 2017 · 4 comments
Closed

Ask SDKName undefined #13

appzone opened this issue Jul 11, 2017 · 4 comments

Comments

@appzone
Copy link

appzone commented Jul 11, 2017

Hi,

i try the example code in here

i try to load code Async, but i got the SDKName undefined

// add a queue event here
SDKName = SDKName || function () {
(SDKName.q = SDKName.q || []).push(arguments);
};

i change SDKName to my own SDK name

if i load it sync, the things ok.

can help?

thanks

@hueitan
Copy link
Owner

hueitan commented Jul 11, 2017

The event will store in the SDKName.q queue array, your SDK should handle and execute SDKName.q and reinitiate the namespace SDKName

Hope this is useful to you 🚀

@cristianDroguett
Copy link

cristianDroguett commented Jul 24, 2017

Hi @hueitan i have the same problem as @appzone I understand about SDKName.q but I did't make it, can you give us an example code?, please. I have this code

(function () {
    FI = FI || function () {
      (FI.q = FI.q || []).push(arguments);
    };
    var s = document.createElement('script');
    s.type = 'text/javascript';
    s.async = true;
    s.src = 'http://localhost/SimpleFiSDK/api/js/bundle.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s);
    })();
    FI.load('9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b', {
    data: {
      plazo: 120,
      monto: 12000000,
    }
});

@hueitan
Copy link
Owner

hueitan commented Jul 25, 2017

@cristianDroguett by the code you given here, FI.load is undefined because your script hasn't loaded yet. you should use

FI('9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b', {
    data: {
      plazo: 120,
      monto: 12000000,
}

then within your bundle.js code, remember to check the queue FI.q and execute them.

hope this is clear to you.

@hueitan
Copy link
Owner

hueitan commented Sep 4, 2017

reopen the issue if you need further help.

@hueitan hueitan closed this as completed Sep 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants