Question:
Can I add as many export functions as I wish on a single page or is there a limit, e.g. 50?
Product:
Editor, What are you trying to achieve?
To simplify my code, I am using export functions rather than cramming all events into the onReady function. All was well until I tried to add my 51st export function, at which point the editor simply refused to add the function and instead switched to adding just an event. What am I missing?
What have you already tried?
Tried to move the event to within onReady code, but so far no luck… Additional information:
Such a surprise is very irritating. There is not a single word on any Wix/Velo forums/documentation about the limit on the number of export functions one can add to a page, and boom! I am hit with a limit at 50.
I see, I’ve never placed that many export functions on a single page, so I didn’t realize there might be a limit, but since limiting things to 50 is quite common in Wix, it’s possible that could be the case.
If you were to rewrite the code like this, would it work correctly?
I see, I had noticed recently that the method for defining events has changed. Personally, I think this change is a good thing. I had various concerns with the previous method. With the old way, if you copied an element with an event set on it and pasted it onto another page or site, there were times when the invisible event would remain without being removed, leading to unintended events happening, which was annoying. Now that everything can be done through Velo code alone, I think the possibility of such issues occurring is zero. I believe psaraph’s question could probably be resolved with this approach as well. By the way, does “continue working” mean that the previous export function style code will continue to work without any changes, or does it require rewriting?
Yes, the dynamic function works, but static ones are discontinued, it seems. I updated the code for the page I was working on, so now all static functions are dynamic, except for those that are called from within onReady function.