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

Cannot read property 'contentWindow' of undefined #37

Open
tanvan81 opened this issue Dec 12, 2018 · 0 comments
Open

Cannot read property 'contentWindow' of undefined #37

tanvan81 opened this issue Dec 12, 2018 · 0 comments

Comments

@tanvan81
Copy link

Hi, I've config cross domain. here my code

<script src="~/Scripts/Global/xdUtils.min.js"></script>
   <script src="~/Scripts/Global/xdLocalStorage.min.js"></script>
   <script type="text/javascript">
       xdLocalStorage.init(
             {
                 iframeUrl: 'http://xxx.com/auth.html',
                 initCallback: function () {
                     console.log('Got iframe ready');
                 }
             }
     );

and after login success, I set data

  xdLocalStorage.setItem("tokenauth", response.access_token, function (data) {
                            if (data.success) {
                                alert("success");
                            } else {
                                alert("false");
                            }
                        });

When I run this code, it appear success

But when I read data


$(document).ready(function () {
            xdLocalStorage.getItem("tokenauth", function (data) {
                console.log("Token:" + data.value);                
            });          
        })

I get error

Cannot read property 'contentWindow' of undefined

Please, get me idea

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

1 participant