![]() |
DOCTYPE and scripted insertions?
I have been using xhtml strict doctype and have used my programming text editor
to test output from php (server side) scripts by copying resulting markup from a view source browser window to a temp file and using the text editors doctype checking capacity. But, when javascript is used to add content after the page loads, the markup is not visible in a view source window. So, how would I determine if a browser is not switch to quirks mode because the added , or remove content is not compliant. I recently have been advised the IE 9 runs javascript differently in quirks mode that in standards mode... specifically has both set/removeEventListener and attach/detachEvent. Thank you for time and attention JK |
If you use the DOM commands to create and add the extra content then the script will update the DOM directly and the DOM will ensure that it generates valid HTML. At least that will be true provided that you only ever ask it to generate valid DOM elements and attributes.
At least using the DOM commands will guarantee that a strict page will still remain in standards mode even if you do add invalid tags or attributes. It is only if you use innerHTML or document.write that you can directly write to the HTML and potentially write something invalid where the browser will have to interpret what you meant and potentially put the page into quirks mode. |
| All times are GMT +1. The time now is 02:46 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.