Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Javascript changed to replace in code

Community Beginner ,
May 13, 2019 May 13, 2019

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) .

Views

285
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 13, 2019 May 13, 2019

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,

^ _ ^

Votes

Translate
LEGEND ,
May 13, 2019 May 13, 2019

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,

^ _ ^

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2019 May 13, 2019

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2019 May 13, 2019

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,

^ _ ^

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2019 May 13, 2019

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,

^ _ ^

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2019 May 13, 2019

Copy link to clipboard

Copied

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2019 May 13, 2019

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,

^ _ ^

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2019 May 13, 2019

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines