Welcome Guest, Not a member yet? Register   Sign In
CI and Quirks Mode
#1

[eluser]Squabbler[/eluser]
Hello,

I'm having a really awkward problem with any view/section other than the MAIN INDEX going into quirks mode. I've done a few tests and one in particular gave me results to where I have no idea what to check anymore.

I basically stripped my main/main_index view down to this:
Code:
<p>Main Index View</p>

I then stripped my about/about_index view to something similar:
Code:
<p>About Index View</p>

Both of these views use the same "header/footer" view named application:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html lang="en"&gt;

&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;title&gt;&lt;?=$page_title;?&gt;&lt;/title&gt;

  &lt;!-- CSS --&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen, projection" href="system/application/assets/includes/css/main.css" /&gt;
  &lt;!-- End CSS --&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;?php echo $content; ?&gt;

&lt;/body&gt;
&lt;/html&gt;

My folder structure is set up as follows:
Code:
applications
|_ controllers
   |_ main.php
   |_ about.php
|_ views
   |_ main
      |_ main_index.php
      |_ main_login.php
   |_ about
      |_ about_index.php
      |_ about_resume.php

My config.php file is set up to load the main controller by default which loads the main_index.php view by default..

For an example of how my controllers are set up:
Code:
&lt;?php  
class Main extends Controller {  

  function index() {
    
    $viewData['example_variable'] = "blah";

    // Load the main_index view
    $data['content'] = $this->load->view('main/main_index', $viewData, true);

    // Set some page variables
    $data['page_title'] = "Home Page, Son!";

    // Load the header / footer..
    $this->load->view('application', $data);

  }  

}
?&gt;

And now for some weird reason, main_index is in standards compliant mode, but about_index is in quirks mode..

Any ideas?

Edit ::::
After more testing, it only seems to be happening in FireFox.. I have version 3.6.8
#2

[eluser]Squabbler[/eluser]
K,

After more trial and error.. I've narrowed it down to the following line in my CONTROLLER..

Code:
// Get top 8 standings for the rounds
$season->weeks[$round_counter]->top8_players = $this->match_model->getTop8SeasonRoundStandings(array('season_id' => $season->id, 'season_round_id' => $round_counter));

Still looking for how this can cause quirks mode.. All the html in the view that is being output with this variable is correct.. The odd part is that there is another line directly above this one with the same concept except it gets top8_matches instead.. but it doesn't cause quirks mode..

More to come..
#3

[eluser]Developer13[/eluser]
WTF is quirks mode???
#4

[eluser]Squabbler[/eluser]
@Developer13: http://www.cs.tut.fi/~jkorpela/quirks-mode.html


I found the issue.. I'm apparently an idiot and forgot quotations while using usort in one of my helpers and for some really weird reason it caused quirks mode in firefox..
#5

[eluser]pkrstic[/eluser]
[quote author="Developer13" date="1288385712"]WTF is quirks mode???[/quote]

When browser tries to guess what you tried to write, and skips doctype. Usually happens when you print something before doctype, ie files with BOM, or some error printed before, in all cases this means you have some unwanted text printed before doctype.




Theme © iAndrew 2016 - Forum software by © MyBB