DOCTYPE (Document type) is used to tell the browser about the version of HTML. Doctype must define at the beginning of the document.
Doctype is to be define as <!doctype html> for HTML 5.Definition
<!doctype html> <html lang="en"> <head> <title> Page Title</title> </head> <body> </body> </html>
1. How to fix Uncaught SyntaxError: Unexpected token < ?
The Syntax error Uncaught SyntaxError: Unexpected token < is caused by following reasons :
- Script tag supposed to have existing js file reference but provided another file
- Also it can caused during ajax call expecting to receive response as defined in ajax url (ex: json) but return other format (ex. nomn json if requested for json)
2. Why exclamation mark is used in before doctype html?
what is markup declaration
According to markupdeclaration.org
Declarative markup is the practice of identifying what information in a document is, typically separate from how it should be processed or presented.Therefore to declare about document it is used exclamation mark. Example 1 : To define any comment it define like <!-- comment --> Example 2: To define any Document type it used exclamation mark before doctype like <!doctype html>