I have a site running on Expression Engine. It appears the webserver was upgraded and now a plugin is throwing an error message. It doesn't seem to be impacting the operation of the site so while I try and remedy the issue I thought I could hide the PHP error message with jquery.
The error message is being put on the page before anything else -> before the DOCTYPE tag.
Here's one line:
Strict Standards: Non-static method Foxee_utils::check_cache() should not be called statically, assuming $this from incompatible context in /home/noelwhit/public_html/admin/modules/foxee/mod.foxee.php on line 228
I was toying with $(document).before() in some way but appear to be a little bit away from greatness just yet.
Thanks.
$(document).before()
-
12I'm sorry, I can't stop laughing at this question title.Mulan– Mulan2013年10月31日 01:07:22 +00:00Commented Oct 31, 2013 at 1:07
-
And you want to do this instead of fix the problem.. why?CrayonViolent– CrayonViolent2013年10月31日 01:08:16 +00:00Commented Oct 31, 2013 at 1:08
-
are only EE super-admins seeing the message? if so why bother?AllInOne– AllInOne2013年10月31日 01:08:37 +00:00Commented Oct 31, 2013 at 1:08
-
1Literally laughed so hard I almost peed.Mulan– Mulan2013年10月31日 01:09:19 +00:00Commented Oct 31, 2013 at 1:09
-
3looks like XY problem :) actually plugin should be fixed, if it is impossible error should be hidden at php side via php.ini or error_reporting, jquery of course can help to hide part of html, but it is so bad solution, I dont want to provide itIłya Bursov– Iłya Bursov2013年10月31日 01:13:38 +00:00Commented Oct 31, 2013 at 1:13
2 Answers 2
This definitely shouldn't be fixed with jQuery. There are at least two ways to fix the problem with other than jQuery:
The hard and proper way. Prefix
Foxee_utils::check_cache()
withstatic
keyword:static function check_cache(/* skip */)
The easy way. Add somewhere in the site configuration files, after other call to
error_reporting()
if there is one:error_reporting(error_reporting() & ~E_STRICT);
2 Comments
That's a duplicate of many questions. But here's your answer
error_reporting(0)
At the top of your page
EDIT: I will strongly advise to not use this answer but if you really want to hack your way... use this answer to help you. Basically you take your inner html, then rewrite your page. But you should sincerely try to solve your problem instead of hiding it... The community is here to help you, make good use of it.
Here's a snippet of his answer :
var markup= document.documentElement.innerHTML;
markup= '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'+markup+'</html>';
document.open();
document.write(markup);
document.close();
9 Comments
Explore related questions
See similar questions with these tags.