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

loadScript loads file multiple times unnecessarily

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.0.5
    • Fix Version/s: 8.5.0
    • Component/s: ZK Client Engine
    • Security Level: Jimmy
    • Labels:

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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