2013-03-07, 07:00 AM
(This post was last modified: 2013-03-07, 02:45 PM by User 65615.)
Certain people prefer to have custom javascripts in their forum. Due to certain so called SYNTAX errors javascript conflicts occur.
How do i find a conflict?
In mybb, simple indications of a conflict are:
These can be solved by:
1. Using jQuery.noConflict();
If you are using jQuery in your forum, a conflict arising can be solved by adding:
just below where you put jQuery.
Example:
2. Using the latest jQuery:
Certain scripts are their that require a higher jQuery version than the one you use. This may also result in undesirable output, conflicts, etc.
You can get the latest version can be obtained from http://jquery.com
You can also use jQuery's MediaTemple CDN hosted jQuery.
3. Using the latest version of ProToType.js
MyBB's current Prototype version is 1.6.0.0. You should replace it with the latest one.
To do so, head over to your theme's templates, open UNGROUPED templates -> headerinclude
Find the url to prototype.js.
It should look like:
Replace it with:
4. Fixing Javascripts call based on jQuery:
If you are using too many many javascripts, then also it is possible that some of them don't work even after you do the above steps.
To fix this, find the jQuery call, looks like:
You can fix it by changing the '$' sign with 'jQuery'
The above code would become:
=========================================
That's all If you experience any other error or my post has got some wrong info/error in codes you can reply here any time
=========================================
How do i find a conflict?
In mybb, simple indications of a conflict are:
- EDIT Button not working
- MultiQuote not working
- MyBB Editor does not appear. [editor.js]
- Your other jQuery based scripts don't work
These can be solved by:
1. Using jQuery.noConflict();
If you are using jQuery in your forum, a conflict arising can be solved by adding:
<script type=text/javascript">jQuery.noConflict();</script>
just below where you put jQuery.
Example:
<script type="text/javascript" src="http://xxx/jquery-1.8.0.min.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>
2. Using the latest jQuery:
Certain scripts are their that require a higher jQuery version than the one you use. This may also result in undesirable output, conflicts, etc.
You can get the latest version can be obtained from http://jquery.com
You can also use jQuery's MediaTemple CDN hosted jQuery.
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.1.min.js"></script>
3. Using the latest version of ProToType.js
MyBB's current Prototype version is 1.6.0.0. You should replace it with the latest one.
To do so, head over to your theme's templates, open UNGROUPED templates -> headerinclude
Find the url to prototype.js.
It should look like:
http://community.mybb.com/jscripts/prototype.js?ver=1600
Replace it with:
http://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js
4. Fixing Javascripts call based on jQuery:
If you are using too many many javascripts, then also it is possible that some of them don't work even after you do the above steps.
To fix this, find the jQuery call, looks like:
<script type="text/javascript">
$(document).ready(function($){
});
</script>
You can fix it by changing the '$' sign with 'jQuery'
The above code would become:
<script type="text/javascript">
jQuery(document).ready(function(){
});
</script>
=========================================
That's all If you experience any other error or my post has got some wrong info/error in codes you can reply here any time
=========================================