MyBB Community Forums

Full Version: Some Javascript isn't working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've noticed after making some edits in my new theme templates that the javascript isn't working. I imagine this is a noconflict error (and when i do a  "inspect code" I see six errors which I have no idea at all how to fix). Anyways, the 'latest threads' on the sidebar have stopped displaying, and any moderator tools for threads and posts are not working either.

https://www.slaveryreport.com

if you need a test user please pm me and I'll provide you with creds.

Thank you!!!
did you try removing the noconflict codes from your theme's header template...



<script type="text/javascript">jQuery.noConflict();</script>
I added that line of code to the top and bottom of the headerinclude, didn't work. i also checked and removed it throughout the forum and that didn't work either.

Here are the codes for:
Header
Index
Footer
Headerinclude

Header:

<div id="likeWrapper">
<a href="https://www.google.com/"><img src="images/qws-tech/quickexit.png"></a>
</div>
<style type="text/css">
.newsbar {
color: #000;
background: #ff0000;
border-top: 2px solid #000;
border-bottom: 2px solid #000;
text-align: center;
margin: 10px auto;
padding: 5px 20px;
font-weight: regular;
}
.newsbar2 {
background: #FFFFFF;
border-top: 2px solid #FFFFFF;
border-bottom: 2px solid #FFFFFF;
border-right: 2px solid #FFFFFF;
border-left: 2px solid #FFFFFF;
text-align: left;
margin: 10px auto;
padding: 5px 20px;
font-weight: bold;
}
.holiday {
color: #000;
background: #008F32;
border-top: 4px solid #FF0000;
border-bottom: 4px solid #FF0000;
text-align: center;
margin: 10px auto;
padding: 5px 20px;
font-weight: bold;
}
.appbanner {
color: #000;
background: #FFFFFF;
border-top: 2px solid #000000;
border-bottom: 2px solid #000000;
border-right: 2px solid #000000;
border-left: 2px solid #000000;
text-align: center;
margin: 10px auto;
padding: 5px 20px;
font-weight: bold;
}
</style>
<style>
#likeWrapper{
   position: fixed;
    right: 3em;
   padding-top: 210px;
}
</style>
<a name="top" id="top"></a>
<div id="mainwidth">
  
<div class="menu" style="margin-top: 0px;">
    <ul>
<li id="nav-emergency"><a href="{$mybb->settings['bburl']}/newthread.php?fid=20"><i style="font-size: 14px;" class="fa fa-plus-square fa-fw"></i><span style="color:red"><b> Emergency Report</b></span></a></li>
<li id="nav-forums"> <a href="{$mybb->settings['bburl']}/index.php"><i style="font-size: 14px;" class="fa fa-globe fa-fw"></i> Home</a></li>
<li id="nav-search"> <a href="{$mybb->settings['bburl']}/search.php"><i style="font-size: 14px;" class="fa fa-search fa-fw"></i> Search</a></li>
<li id="nav-member"> <a href="{$mybb->settings['bburl']}/memberlist.php"><i style="font-size: 14px;" class="fa fa-user fa-fw"></i> Members</a></li>
<li id="nav-ban"><a href="{$mybb->settings['bburl']}/bans.php"><i style="font-size: 14px;" class="fa fa-ban"></i><b> Bans</b></a></li>
<li id="nav-calendar"> <a href="{$mybb->settings['bburl']}/calendar.php"><i style="font-size: 14px;" class="fa fa-calendar fa-fw"></i> Calendar</a></li>
<li id="nav-help"> <a href="{$mybb->settings['bburl']}/misc.php?action=help"><i style="font-size: 14px;" class="fa fa-life-ring fa-fw"></i> Help</a></li>
   <ul>
</div>
 
<br />
   <div id="float_right"> {$welcomeblock}</div>
<div id="logo" style="margin-top: -20px;">
				<div class="wrapper">
					<div id="float_left"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" /></a></div>
                              </div>
                         </div>
      <div id="mbox" style="margin-top: -20px;">
<div id="container">
		<a name="top" id="top"></a>
		<div id="header">
		<div id="content">
			<div class="wrapper">
                 <navigation><br />
<p class="newsbar">
<a href="tel:911">Dial 911 (USA)</a> | <a href="tel:1-800-225-5324">Federal Bureau of Investigation</a> | <a href="tel:7034655495">Intl Justice Mission</a> | <a href="tel:330149745137">French Foreign Legion</a>
</p>
                {$bannedwarning}
				{$bbclosedwarning}
				{$unreadreports}
				{$pending_joinrequests}
				{$awaitingusers}
                {$pm_notice}


Index:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	lang.no_new_posts = "{$lang->no_new_posts}";
	lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body id="forums">
{$header}
<div class="side" style="float: right; width: 23%">
  
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder2">
<tr>
<td class="thead2">
<div class="float_left"><strong>Go social?</strong></div> 
</td>
</tr>
<tr>
<td class="trow3">
<a href="https://www.facebook.com/SlaveReport"><img src="images/vienna/facebook.png" style="vertical-align: middle" alt="" title="Like us on Facebook!" /></a>
<a href="https://twitter.com/Slavery_Report"><img src="images/vienna/twitter.png" style="vertical-align: middle" alt="" title="Tweet us on Twitter!" /></a>
<a href="https://www.slaveryreport.tumblr.com"><img src="images/vienna/tumblr.png" style="vertical-align: middle" alt="" title="Follow us on Tumblr!" /></a>
<a href="http://www.mobile.slaveryreport.com"><img src="images/vienna/mobile.png" style="vertical-align: middle" alt="" title="Use our mobile app!" /></a>
</td>
</tr>
</table>
  
  <br />  
  

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder2">
<tr>
<td class="thead2">
<div class="float_left"><strong>Board stats</strong></div> 
</td>
</tr>
<tr>
<td class="trow3">
{$forumstats}
</td>
</tr>
</table>
  <br />
  <script type="text/javascript">
	jQuery(function(){
		jQuery(".latestthreads").load("{$mybb->settings['bburl']}/portal.php .latestthreads_portal");
	});
	</script>
  
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder2">
<tr>
<td class="thead2">
<div class="float_left"><strong>Latest activity</strong></div> 
</td>
</tr>
<tr>
<td class="trow3">
				<div class="latestthreads float_left"></div>
		</td>
</tr>
</table>
  <br />
</div>
<div class="forum" style="float: left; width: 76%;">{$forums}</div>
{$boardstats}
<br class="clear" />
{$footer}
</body>
</html>


Footer:
<debugstuff>
	</div>
</div>

</div></div>
<style type="text/css">

.newsbarfoot {
	color: #000;
	background: #81AFFF;
	border-top: 2px solid #2603E9;
	border-bottom: 2px solid #2603E9;
	text-align: center;
	margin: 10px auto;
	padding: 5px 20px;
	font-weight: bold;
}
</style>
<p class="newsbarfoot">If you have an urgent report, call the National Human Trafficking Resource Center (USA): <a href="tel:1-888-3737-888">1-888-3737-888</a></p>

<div id="footer">
	<div class="upper">
		<div class="wrapper">
			{$lang_select}{$theme_select}
			<ul class="menu2 bottom_links" style="margin-top: 10px;">
              <li><a href="{$mybb->settings['bburl']}/misc.php?action=syndication"><i style="font-size: 16px;" class="fa fa-rss fa-fw"></i> &nbsp;</a></li>
				<li><a href="#top">{$lang->bottomlinks_returntop} &nbsp;</a></li>
				<li><a href="<archive_url>">Lite mode &nbsp;</a></li>
                {$contact_us} &nbsp;
                <li><a href="{$mybb->settings['bburl']}/myawards.php">Awards &nbsp;</a></li>
                <li><a href="{$mybb->settings['bburl']}/mysubscriptions.php">Subscriptions &nbsp;</a></li>
                <li><a href="misc.php?action=switch_version&amp;do=mobilel&amp;my_post_key={$GLOBALS['gmb_post_key']}">Switch to Mobile</a></li>
			</ul>
		</div>
	</div>
	<div class="lower">
		<div class="wrapper">
          {$auto_dst_detection}
          {$affiliates}<br/>
			<div class="smalltext"><span id="current_time">Theme © 2014 iAndrew </span></div>
			<span id="copyright">
				<!-- MyBB is free software developed and maintained by a volunteer community.
					It would be much appreciated by the MyBB Group if you left the full copyright and "powered by" notice intact,
					to show your support for MyBB.  If you choose to remove or modify the copyright below,
					you may be refused support on the MyBB Community Forums.

					This is free software, support us and we'll support you. -->
				{$lang->powered_by} <a href="http://www.mybb.com" target="_blank">MyBB{$mybbversion}</a>, &copy; 2002-{$copy_year} <a href="http://www.mybb.com" target="_blank">MyBB Group</a>.
				<!-- End powered by -->
			</span>
		</div>
	</div>
</div>
<!-- The following piece of code allows MyBB to run scheduled tasks. DO NOT REMOVE -->{$task_image}<!-- End task image code -->
{$auto_dst_detection}
</div>


Headerinclude:
<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" />
<link href='//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,200italic,400italic,600italic' rel='stylesheet' type='text/css'>
<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->asset_url}/jscripts/jquery.js?ver=1800"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.plugins.min.js?ver=1800"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1800"></script>
<script type="text/javascript" src="images/vienna/jquery-ui.js"></script>
<script type="text/javascript" src="images/vienna/jquery.tipsy.js"></script>
<script type="text/javascript" src="images/vienna/jquery.cookie.js"></script>
<script type="text/javascript">
    var unreadAlerts = {$mybb->user['unreadAlerts']};
</script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/myalerts.js"></script>


<script type='text/javascript'> 
jQuery(function() {
jQuery("a").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("title").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("img").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("i").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("span").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("div").tipsy({gravity: jQuery.fn.tipsy.autoNS});
  });
</script>

{$stylesheets}
<script type="text/javascript">
<!--
	lang.unknown_error = "{$lang->unknown_error}";

	lang.select2_match = "{$lang->select2_match}";
	lang.select2_matches = "{$lang->select2_matches}";
	lang.select2_nomatches = "{$lang->select2_nomatches}";
	lang.select2_inputtooshort_single = "{$lang->select2_inputtooshort_single}";
	lang.select2_inputtooshort_plural = "{$lang->select2_inputtooshort_plural}";
	lang.select2_inputtoolong_single = "{$lang->select2_inputtoolong_single}";
	lang.select2_inputtoolong_plural = "{$lang->select2_inputtoolong_plural}";
	lang.select2_selectiontoobig_single = "{$lang->select2_selectiontoobig_single}";
	lang.select2_selectiontoobig_plural = "{$lang->select2_selectiontoobig_plural}";
	lang.select2_loadmore = "{$lang->select2_loadmore}";
	lang.select2_searching = "{$lang->select2_searching}";

	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 rootpath = "{$mybb->settings['bburl']}";
	var imagepath = "{$theme['imgdir']}";
  	var yes_confirm = "{$lang->yes}";
	var no_confirm = "{$lang->no}";
	var MyBBEditor = null;
	var spinner_image = "{$theme['imgdir']}/spinner.gif";
	var spinner = "<img src='" + spinner_image +"' alt='' />";
// -->
</script>
{$newpmmsg}
remove noconflict code from myalerts.js file and you may have to remove jQuery cookies script.
if above doesn't help then you may PM me temporary access to admin panel to check the referred issues
Ok, that did the trick. However, on the forums where I am trying to use xThreads (I haven't been able to make the theme edits to reflect xthreads fields, but the global templates are still there), the inline moderator actions don't work. But on regular forums, the inline moderation works fine.