0

Is there any white space character in the below lines.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Because, Im getting a syntax error like unexpected token for the above lines.

I just want to know whether there is any white space character in the above two lines, because

1)in our server,we have minify option to remove white space characters.It is mandatory to enable minify option. However if I disable minify then I dont get the above syntax error.

2)Just thinking whether any white space character is getting removed from the above two lines

and hence getting the syntax error.

May I know whether I have any white space characters in the above two lines.

Thanks, Balaji

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
balaji
  • 774
  • 1
  • 16
  • 42
  • If you're getting an unexpected token `<`, you're probably trying to eval() the string into JavaScript. – Michael Berkowski Sep 04 '12 at 12:45
  • Well, space is whitespace. And it's exactly what separates `DOCTYPE` and `html`. – raina77ow Sep 04 '12 at 12:46
  • 1
    I wonder though, why do you have to minify *HTML*? – raina77ow Sep 04 '12 at 12:48
  • Which server are you using? I don't know of any with a "minify html" option. In any case, there is a bug in the minification if it cannot handle a doc-type. – Steve Campbell Sep 04 '12 at 13:27
  • Thanks for your reply, actually minify is used for compressing both css/js files – balaji Sep 04 '12 at 13:30
  • possible duplicate of [How to strip whitespace-only text nodes from a DOM before serialization?](http://stackoverflow.com/questions/978810/how-to-strip-whitespace-only-text-nodes-from-a-dom-before-serialization) – Paul Sweatte Feb 04 '14 at 22:19

0 Answers0