Is there anyone else who is facing the same issue?
Or should I move the script into our server for the best experience? Please suggest.
You'd have to supply a URL. Can't troubleshoot your page without seeing it.
It's a clear race condition, because you're asynchronously injecting a (redundant) jQuery library and then trying to access it immediately. This doesn't happen on the other page because the jQuery library is also loaded earlier.
The best solution is of course to avoid using jQuery at all, since it distracts from learning real JS.
But if you must use jQuery, you still don't need to reload it in the Rich Text. The Forms 2.0 library already includes jQuery.
So you can remove
and useinstead of .
As an aside, this is just terrible code:
If you're testing for the string "interactive", then test for the string "interactive"! Don't understand what would possess someone to look for the letters "in" anywhere in a string instead of the actual match. Such extreme "shortcuts" (which actually are bugs) are unacceptable on a professional site.
Thanks, Sir! I know on this website there are so many unacceptable things as stakeholder was managing it by themselves and they kept adding whatever code they wanted without noticing any further circumstances. I am trying to fix the things one by one.