Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Jquery work well in quirks mode?

Tags:

jquery

doctype

For reasons beyond my control, the site works in quirks mode. Will Jquery help me in this situation?

I expect the jquery developers concentrate on strict mode today - the mode of the future. On the other hand, all those libraries once started to ease the pain of working in quirks mode.

like image 653
buti-oxa Avatar asked Sep 30 '09 20:09

buti-oxa


People also ask

What is quirks mode in Javascript?

In computing, quirks mode is a technique used by some web browsers for the sake of maintaining backward compatibility with web pages designed for old web browsers instead of strictly complying with W3C and IETF standards in standards mode.

What is standard mode and quirks mode in HTML?

in quirks mode, document. body (the body-element) is the root element and in standard mode it's the html-element (document. documentElement). quirks mode is for the old rules of browsers, they made it so that old websites that were written before the world wide web came and before HTML5 was invented don't break.


1 Answers

According to jQuery Migrate Plugin - Warning Messages

JQMIGRATE: jQuery is not compatible with Quirks Mode

Cause: A browser runs in "quirks mode" when the HTML document does not have a <!doctype ...> as its first non-blank line, or when the doctype in the file is invalid. This mode causes the browser to emulate 1990s-era (HTML3) behavior. In Internet Explorer, it also causes many high-performance APIs to be hidden in order to better emulate ancient browsers. jQuery has never been compatible with, or tested in, quirks mode.

Solution: Put a valid doctype in the document and ensure that the document is rendering in standards mode. The simplest valid doctype is the HTML5 one, which we highly recommend: <!doctype html> . The jQuery Migrate plugin does not attempt to fix issues related to quirks mode.

like image 140
Ardalan Shahgholi Avatar answered Sep 28 '22 09:09

Ardalan Shahgholi