Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2591

zk.loadScript() can check file existence

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Normal Normal
    • 8.0.0
    • 7.0.4
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.0.1
    • None

      Requirement Description

      When we load an external script like
      zk.loadScript('http://ende.de/test.js', 'myscript');

      It might fail to load the external script. In such case, the whole application will halt on Processing message and go timeout with the message:
      Error code 1: ZK error, before mounting. ...

      Although users can see an error message in developer tool. Maybe ZK can check a script's existence before loading.

      Current Workaround

      Check before loading like:
      http://www.kirupa.com/html5/checking_if_a_file_exists.htm
      http://stackoverflow.com/questions/3646914/how-do-i-check-if-file-exists-in-jquery-or-javascript

      Proposed solution

      allow to pass a callback function. ZK calls the callback function after loading is done and pass the loading status no matter succeed or fail.

            ChunfuChang ChunfuChang
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h