0

I have a small script which has a closing tag which looks like this:

</script >

Note the space at the end.

It seems this causes issues in different validators and editors.

Is it invalid to have the space?

UPDATE: You can see in the following fiddle what I mean:

https://jsfiddle.net/vcv59vd7/

The closing script tag is highlighted in red with the space and not without.

I've seen Google have parsing difficulties in the past from invalid code so this is my concern.

Adders
  • 665
  • 8
  • 29

2 Answers2

0

go to jsFiddle website and test it out.

  <script>
      window.onload(document.write("success"))
  </script>

and afterwards just put a space into the closing tag. you can also close the tag like this:

  <script>window.onload(document.write("success"))/>
Tibix
  • 400
  • 3
  • 12
  • It runs. However, you can see it highlights it red https://jsfiddle.net/vcv59vd7/ – Adders Aug 24 '17 at 08:59
  • Yep. Depending on ur editor it will correct it or auto complete the closing tag as soon you write the opening tag. Such like Visual Studio Code. – Tibix Aug 24 '17 at 09:33
-1

It's valid. Your issue's likely coming from elsewhere. Paste more codes to check.

Jackson Ng
  • 368
  • 2
  • 16