- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2019 06:07 AM
Hello All,
I use to define general functions in onLoad Client Script which are later used in onChange Client Scrips - but this does not work for Catalog Client Scripts !.
Does anyone know how this can be achieved for Catalog Client Scripts?
Thanks and best regards,
Victor
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2019 10:09 AM
Got to the issue after some investigation; I needed to uncheck the Isolate script checkbox - although I am not doing any DOM manipulation.
Regards,
Victor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2019 06:15 AM
you can define that function inside UI Script and then you can use it in your catalog client script or any client side script.
Kindly have a look on below doc link for further details about UI Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2019 10:09 AM
Got to the issue after some investigation; I needed to uncheck the Isolate script checkbox - although I am not doing any DOM manipulation.
Regards,
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-23-2020 12:30 AM
This helped me as well. It was sufficient to uncheck it for the "onLoad" client script. All "onChange" client scripts could stay with checked "Isolate script" to use the function from "onLoad".
I have also defined the function outside of the "onLoad" function as defining it inside did not work for me (Orlando release):
function onLoad() {}
function myNewReusableFunction() {}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2022 07:06 AM
I defined the function at "onLoad", out side of the onLoad() function. I called it at onChange, but it threw this error: "Error while running Client Script "...": ReferenceError: [function_name] is not defined". "Isolcate script" onLoad is unchecked. It shows the error even I checked or unchecked the "Isolate script" at onChange script.