Emptied all Pro JS fields, but my JS code still appears in the page source

I deleted my JavaScript codes but they still appear in page source. These codes were inserted to the theme option’s JS fields. I have since removed all codes, reverting the page to a blank state, and then deleted the homepage’s cache. Yet, the codes are all still present in the page source.

This problem started when I noticed at some point that the global JS code stopped reflecting changes, which was verified via console logging. Then, I noticed that the arrow that expands or retracts the JS field in theme options was not responding, so I reloaded the whole page, and that’s when the JS field appeared empty all of a sudden. All of my code was gone from it, yet all of it works and seems to have stuck in the page source since then.

Edit: Just to pinpoint another possible source of the problem, the global JS was once accidentally copied from my JS editor and saved directly into the homepage rather than the global JS in theme options. However, both are blank now and the problem still occurs. I tried disabling all plugins and reverting to the original Pro theme then back to the child theme (which I created using your instructions in the documentation) to no avail.

The duplicated scripts are the very last thing in the <body> tag, inside this element: <script id="x-custom-js"></script>

Hello @SinanDira,

Thanks for writing to us.

I tried to access your site dashboard but unfortunately, the given login credentials are not working please recheck and send us again.

Thanks

Retry with this email and new password.

Turns out I had copied the nickname instead of the username. My bad.

Hi Sinan,

The code still there in Theme option’s -> JS. Remove the code and check the same issue.

Hope it helps.
Thanks

Oh my, very strange. Everything is working normally now, even though I can swear the Global JS pane was empty earlier.

Anyways, thanks!

Hi Sinan,

Glad to help you. Have a nice day.

Thanks

Thank you. While you’re at it, can you please tell me if you know anything about the interchangeability of “jQuery” and “$” in the JS pane? The dollar sign seems not to work half the time.

Hi Sinan,

We use jQuery instead of $ to avoid conflict with other libraries. Please check this link to know more about conflict and how to avoid it.

Thanks

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.