MyBB Community Forums

Full Version: jQuery problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm working on a different theme. Navigation menus, contains JavaScript elements. However, when I add this code in the headerinclude template, editor codes do not appear. But when I add to the index template is running. This time does not appear on all pages. Remove any element of the action does not work when the menu navigation buttons and the editor seems to belong to. I'm waiting for a response from authorities.

Regards...

<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1400"></script>
{$stylesheets}
<script type="text/javascript">
<!--
	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var imagepath = "{$theme['imgdir']}";
// -->
</script>
{$newpmmsg}
<script type="text/javascript" src="images/nesil3/dhtmlwindow.js"></script>
<script type="text/javascript" src="images/nesil3/modal.js"></script>
<script type="text/javascript" src="images/nesil3/jquery-1.2.6.js"></script>
<script type="text/javascript" src="images/nesil3/other.js"></script>
Have you done a view source to see if the code shows up in the source?
Here you can view the file.
I see that you are using jquery. Did you set up the no conflict for jquery because it will conflict with prototype which mybb uses. It doesn't look like you are using no conflict. Check out the link below.

http://docs.jquery.com/Using_jQuery_with..._Libraries
Yes. I used jQuery. But the problem is: "How can I run this action without any conflict??" . I looked your document, but I don't understood well.

Thanks.
You want to place jQuery.noConflict(); at some point after the jquery.js. Then in your jquery code you will need do jQuery("div").hide(); instead of $("div").hide();
Sorry. Unfortunately, my knowledge is not good at jScript. If the files you can edit like that? There are 4 files in the ZIP file.
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1400"></script>
{$stylesheets}
<script type="text/javascript">
<!--
    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var imagepath = "{$theme['imgdir']}";
// -->
</script>
{$newpmmsg}
<script type="text/javascript" src="images/nesil3/dhtmlwindow.js"></script>
<script type="text/javascript" src="images/nesil3/modal.js"></script>
<script type="text/javascript" src="images/nesil3/jquery-1.2.6.js"></script>
<script type="text/javascript" src="images/nesil3/other.js"></script>
// Added
<script type="text/javascript">
jQuery.noConflict();
</script>
// End of add

Take a look a the change I made in the code from your original post. In your code now you will need to change $('div') to jQuery("div")
Thank you very much.