CodeIgniter Forums

Full Version: Profiler deletes anything between </body> and </html>
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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?

El Forum

[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

El Forum

[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.

El Forum

[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.