MyBB Community Forums

Full Version: Simple noConflict file edit that fixed all my jQuery issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just modified functions.php

found
$contents = $plugins->run_hooks("pre_output_page", $contents);

and added after

$contents = str_replace("<body", "<body onload='javascript:$.noConflict();'", $contents);

and all my jQuery conflicts were fixed, well 99% of them. I still have some issues when a remote ad loads more jQuery but that is rare.

So far, so good. As long as the page loads and is not cutoff, the noConflict works for all local and remote <script> calls, even inline stuff.
Is this the right section, pavemen? lol
i don't know. It's "preemptive support" in case someone runs into my issue? If mods want to move it, they can. The hassles of multiple tabs being open to the same site... forget where you are....
I do wonder if this can resolve the "undefined" issues that some users are experiencing.
that was one of the problems I was having. the place that now owns my old big board changed their JS based "network" banner theother day and it started breaking all posts and PMs, plus the other JS based functions (inline selections, multiqoute, etc)

it has taken me three days to figure out this simple solution, but again, it does need to the entire DOM object to load first, since that is when the body's onload event fires.