Copy link to clipboard
Copied
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) .
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,
^ _ ^
Copy link to clipboard
Copied
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,
^ _ ^
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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,
^ _ ^
Copy link to clipboard
Copied
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,
^ _ ^
Copy link to clipboard
Copied
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
Copy link to clipboard
Copied
Nope.. you're using HTML 4.01. If you remove everything after <!DOCTYPE HTML, then you'll be using HTML5 standards (at least that's what it is reporting to the browser.) Not sure if the absence of type or language attributes will impact older HTML standards. Nancy O'Shea​ would know that better than I, methinks.
V/r,
^ _ ^
Copy link to clipboard
Copied
I changed the document type to HTML 5 and it now shows: <!doctype html>
The script on the page is still doing what it is supposed to do if that means anything.