Announcement

Collapse
No announcement yet.

[CLOSED] [#768] [1.10.3] 1.10.2 and initialization

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [CLOSED] [#768] [1.10.3] 1.10.2 and initialization

    When the script is loaded in late (after dom is loaded), it does not work (i can try do an example, but it takes some time, no need to use code, the problem is only loading the script bridge.js.
    I check the code :
                if (document && (document.readyState === "complete" || document.readyState === "loaded")) {
                    fn();
                } else {
                    Bridge.Class.$queue.push(Class);
                    Class.$staticInit = fn;
                }
    If i comment the first part and using always the second, i have no problem.
    Last edited by Cestbienmoi; 2015-12-05 @ 04:04 PM.

    #2
    An example :
    <!DOCTYPE html>
    
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta charset="utf-8" />
        <title></title>
        <script>
            function delayLoad()
            {
                setTimeout(load, 2000);
            }
    
            function load()
            {
                var head = document.getElementsByTagName('head')[0];
                var script = document.createElement('script');
                script.type = 'text/javascript';
                script.onload = function() {
                    console.log("Bridge loaded");
                    //doLoad();
                }
                script.src = '../output/bridge.js';
                head.appendChild(script);
            }
        </script>
    </head>
    <body onload="delayLoad()">
    
    </body>
    </html>
    The console get :
    Uncaught TypeError: Expecting a function in instanceof check, but got undefined
    core.merge @ bridge.js:372
    Bridge.define.statics.constructor @ bridge.js:2456
    fn @ bridge.js:2053base.define @ bridge.js:2058
    (anonymous function) @ bridge.js:2428
    (anonymous function) @ bridge.js:10324
    The row :
    if (to instanceof Bridge.Decimal && Bridge.isNumber(from)) {
    because Bridge.Decimal is undefined !
    Last edited by Cestbienmoi; 2015-12-05 @ 04:03 PM.

    Comment


      #3
      Thanks for this report. We will investigate and attempt to reproduce locally.

      Comment


        #4
        Git issue: https://github.com/bridgedotnet/Bridge/issues/768

        Comment


          #5
          Hi Cestbienmoi,

          We have fixed the issue and will include the fix into 1.10.3.

          Thank you for taking your time and reporting the issue.

          Comment

          Working...
          X