javascript - Document Type Definition in html -


if add js script above line <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> css not working. there way solve issue

<script type="text/javascript"> <?php  $data3  = getmaildata(); ?> var collection = [<?php echo  $data3; ?>];  </script> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org  /tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head> <title>.:: sample ::.</title> <link rel="stylesheet" href="css/stylesheet.css" type="text/css"> 

a script element can appear in head or in body, can't appear before doctype , no element can appear outside root element (<html>).

if doctype (with couple of provisos don't apply in case) isn't first thing in document browsers enter quirks mode (and emulate bugs seen in older browsers css , dom handling).

there no way around (that supported browsers), write valid code , don't try put script element somewhere isn't allowed.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -