ZK - zul multiple header registration issue

asked 2020-09-26 01:37:10 +0800

vsriram92 gravatar image vsriram92
33 3

For a window, the scripts are getting added into <head> tag multiple times. How to avoid this multiple script registration into head tag?

zk version: 7.0.8

ZK Fiddle:

Steps to reproduce in Zk fiddle:
1. Open
2. Close
3. Open
4. Repeat....

You can see that test.js script has been registered twice in the head section.
The number of times you open the window, the test.js script is registered for those number of times.
Verify it using browser's inspect element. Search for "src="test.js"". You will get the count.

Let me know how to fix this? Any patch releases? Any workarounds for removing them from headers?

Reason for this ask: External paid JS is getting registered multiple times causing the license count to expire very soon as multiple callbacks are registered multiple times.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-28 10:58:22 +0800

cor3000 gravatar image cor3000
5399 2 7
ZK Team

updated 2020-09-28 10:58:38 +0800

The known issue, that seems to match your case is ZK-3700 which was fixed in 8.5.0 (3 years ago). For 7.0.8 there's no patch available.

As an alternative, scripts can be loaded and removed in multiple ways. Based on your description it doesn't sound like removing the script and re-loading/re-executing it again will actually solve your license issues. Did you mean to load/execute it only once instead and then keep it in the browser until it's needed next time?

If you already have a custom widget associated with your 3rd party script you can load it from inside the widget package descriptor (.wpd file), which will load a script on demand only once (as used by any zk widget internally) using the <script>-element.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2020-09-26 01:37:10 +0800

Seen: 10 times

Last updated: Sep 28

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More