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

loadScript loads file multiple times unnecessarily

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.0
    • 8.0.5
    • ZK Client Engine
    • Security Level: Jimmy

      Steps to Reproduce

      run the attached example
      click "reload script" once or multiple times
      verify result using "check loaded"

      Current Result

      initially

      • the script is loaded by name "loadedScript" OK
      • check loaded returns true OK
      • there is a single <script> element with src="loadedScript.js"

      after clicking "reload script"

      • the script loads and executes again even though it has been loaded before - unnecessary
      • each reload adds another redundant <script> element to the page

      Expected Result

      when a script is already loaded (zk.isLoaded returns true) it shouldn't load the script again

      Workaround

      call zk.isLoaded manually before reloading a script

            DevChu DevChu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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