Weird javascript problem

I have some javascript function calls in my product descriptions content.

Now whenever I go to edit the products I always see the following text inserted around my javascript

"function anonymous() {"

so the html looks something like:

function anonymous() { myFunction(param1,param2) }

where as when I was adding the producting it only had my javascript code:

myFunction(param1,param2)

happens everytime, it's so annoying. has this happened to anyone else?

Thanks
https://diceus.com/health-insurance-quoting-software/
Last edited on
So your original "html" (javascript in a script tag?) was a single function call.

Obviously the extra stuff didn't appear magically.

So, for instance, you aren't editing this html in a text editor. What are you using to edit it? Presumably that is adding the extra code.

Wrapping JS code in an "anonymous function" is one way to restrict the scope of any variables defined in the JS, to keep them from being global. (But what if you wanted global variable?)

Anyway, how are you editing this html?
Is the extra stuff causing your JS to not function properly?
Or is it just the sight of the extra stuff that's annoying?
Last edited on
Topic archived. No new replies allowed.