CodeIgniter Forums
Profiler deletes anything between </body> and </html> - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Profiler deletes anything between </body> and </html> (/showthread.php?tid=10532)



Profiler deletes anything between </body> and </html> - El Forum - 08-03-2008

[eluser]dmorin[/eluser]
Enabling the Profiler appears to remove anything between </body> and </html>. This space can be used to load javascript that may not be needed until after the page has loaded and removing it can effect page operations.

Is anyone else seeing this behavior?


Profiler deletes anything between </body> and </html> - El Forum - 08-03-2008

[eluser]Colin Williams[/eluser]
Well, the only valid child elements for <html> are <head> and <body>. So, it's a pretty safe and standard assumption the profiler class is making. Should it EXPECT your markup to be invalid? I think not (although it could probably get away with just replacing </body&gtWink


Profiler deletes anything between </body> and </html> - El Forum - 08-03-2008

[eluser]dmorin[/eluser]
I completely agree that it's not valid markup. However, I think that your solution of just replacing the </body> will lead to fewer issues down the road for the community.


Profiler deletes anything between </body> and </html> - El Forum - 08-05-2008

[eluser]Derek Allard[/eluser]
The danger of only removing </body> is that its much more likely to grab content out of a page. Typically javascript would go above </body> and not beneath it. I'm not sure it would be worthwhile to make this change in CI core, but you could easily create a MY_output.php library or hack _display() in output.php.