Question

For a web application which doesn't have the doctype declaration on the first line and thus renders in quirks mode I am trying to display a simple line graph. To display the graph I use Highcharts (http://www.highcharts.com), which uses jQuery. I include jQuery 1.8.3. as well as some other js files with the necessary javascript.

The following behaviour is observed:

  • When opening the page with the jQuery-made highcharts graph nothing is shown. When pressing F12 and clicking on "script" I can see the javascript files are all included correctly though.
  • After this, when pressing F12 and setting the document mode to e.g. 'default settings for IE8' the page reloads, and the graph is shown.
  • After this, when changing back the document mode to quirks mode, the jQuery graph is still visible (the hover effects have a little lag, but that's ok)
  • When opening aforementioned page in a new browser tab, it immediately loads the jQuery graph

Also: pure javascript (without jQuery) always works directly ok, without having to do this trick (switching the document modus away from quirks mode).

Is there any way I can force the browser to render this page NOT in quirks mode? If not, is there a graph tool which only uses pure javascript, no jQuery which I could maybe use?

Was it helpful?

Solution

Is there any way I can force the browser to render this page NOT in quirks mode?

Yes, by adding a doctype. If that isn't an option, then no, other than presenting the graph in an iframe that does have a doctype.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top