Skip to main content
Known Participant
June 7, 2022
Answered

Is it safe to delete old Javascript code?

  • June 7, 2022
  • 1 reply
  • 310 views

Hi all,

 

I'm using RH 2020.7.46 working with an inherited project, which has been upgraded several times from older versions of RH over the years. I've noticed there are some pages which have an old script at the end of the code before the </body> tag

  <script type="text/javascript" language="JavaScript1.2">
    //<![CDATA[
    if (typeof(InitEffects) != 'function') InitEffects = new Function();
    InitEffects('h21');
    InitEffects('h22');
    InitEffects('h23');
    InitEffects('h24');
    InitEffects('h25');
    InitEffects('h26');
    InitEffects('h27');
    //]]>
  </script>

 I'm not entirely sure what this code does, or why it's only on some of the pages. I'm cleaning up some of the HTML which has inherited lots of extra code along the way, including text formatting and external links rather than project links, just because of the way the data has been handled in the past. 

 

Can anyone tell me what this script is for, and if I can remove it?

 

Thanks,

Mikey 🙂 

    This topic has been closed for replies.
    Correct answer Amebr

    I think in Classic it was to do with DHTML effects (mouse rollovers etc). I haven't used any of those in about 20 years, so haven't investigated if it's possible to use them in New UI. I think it's probably okay to remove, but as always, make sure you have a backup and test thoroughly.

    1 reply

    AmebrCommunity ExpertCorrect answer
    Community Expert
    June 7, 2022

    I think in Classic it was to do with DHTML effects (mouse rollovers etc). I haven't used any of those in about 20 years, so haven't investigated if it's possible to use them in New UI. I think it's probably okay to remove, but as always, make sure you have a backup and test thoroughly.

    Known Participant
    June 15, 2022

    Thank you. I removed them from a couple of pages and tested the output was functioning correctly. So far so good. I tend to make a full backup at least once a week anyway, and more if I'm making any major changes, so have made a backup here just in case. I've removed them from all the pages where they were appearing and so far all seems ok! 🙂