Skip to main content
Participating Frequently
May 13, 2019
Answered

Javascript changed to replace in code

  • May 13, 2019
  • 1 reply
  • 385 views

When I open one of my older files where JavaScript was used, <script LANGUAGE="Javascript"> has been changed to <replace LANGUAGE="Javareplace"> and everywhere where it once said <script> it now says <replace>. I don't know why this is happening and I don't know what to do with it. Change it back or leave it as changed.

I am using CC (v 18.2) .

This topic has been closed for replies.
Correct answer WolfShade

Actually.. I should have checked one thing before I mentioned that.

Are you using <!DOCTYPE html>?  Because if you are using anything else, you are not using HTML5 standards.

V/r,

^ _ ^

1 reply

WolfShade
Legend
May 13, 2019

Sounds to me as though someone decided to do a site-wide find and replace, changing "script" to "replace".  Whether it was done intentionally or accidentally is no matter, now, as it's too late.

You _could_ try to reverse it, but that _could_ also create more problems.  The best way to fix it, also the slowest, is to do a site-wide find of the word "replace", and change them one by one.

BTW.. <script language="javascript"> and <script type="text/javascript"> no longer need the language or type attributes.  Javascript is now the default when using the <script> tag.

HTH,

^ _ ^

chk3273Author
Participating Frequently
May 13, 2019

That is very helpful. I may have done that myself by accident. If I understand your final paragraph correctly, I only have to use <script> and </script>

Chas

WolfShade
Legend
May 13, 2019

chk3273  wrote

If I understand your final paragraph correctly, I only have to use <script> and </script>

That is correct.  With the HTML5 standard, if you are using Javascript, you no longer have to declare it as it is "default"; you do need to use the type if it is anything other than Javascript.

V/r,

^ _ ^