Javascript 类别下拉列表仅适用于联系人';s页

Javascript 类别下拉列表仅适用于联系人';s页,javascript,php,jquery,osclass,Javascript,Php,Jquery,Osclass,我在我的网站上有一个包含各种类别的下拉菜单,但是这个下拉菜单只能在我的联系人页面上使用。我在下面添加了一个带有我的代码的链接 <?php /* * Osclass – software for creating and publishing online classified * advertising platforms * * Copyright (C) 2014 OSCLASS * * This program is free software: you can redistribu

我在我的网站上有一个包含各种类别的下拉菜单,但是这个下拉菜单只能在我的联系人页面上使用。我在下面添加了一个带有我的代码的链接

<?php
/*
* Osclass – software for creating and publishing online classified
* advertising platforms
*
* Copyright (C) 2014 OSCLASS
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php echo str_replace('_', '-', osc_current_user_locale()); ?>">
<head>
<?php osc_current_web_theme_path('common/head.php') ; ?>
</head>
<body <?php bender_black_body_class(); ?>>



<div class="uptop">

<?php if( osc_users_enabled() || ( !osc_users_enabled() && !osc_reg_user_post() )) { ?>

<a href="<?php echo osc_item_post_url_in_category(); ?>"><?php _e("Publish your ad for free", 'bender_black');?></a>

<?php } ?>

</div>



<div id="header">

<!-- header ad 728x60-->
<div class="ads_header">
<?php echo osc_get_preference('header-728x90', 'bender_black'); ?> <!-- THIS WAS AN ADs PLACED AT THE TOP OF LOGO -->
<!-- /header ad 728x60-->
</div>
<div class="clear"></div>
<div class="wrapper">
<div id="logo">
<?php echo logo_header(); ?>
<span id="description"><?php echo osc_page_description(); ?></span>
</div>
<ul class="nav">
<?php /* if( osc_is_static_page() || osc_is_contact_page() ){ COMMENTING THIS OUT SO THAT SEARCH & CATEGORY SHOWS ON ALL PAGES */ ?>
<li class="search"><a class="ico-search icons" data-bclass-toggle="display-search"></a></li>
<li class="cat"><a class="ico-menu icons" data-bclass-toggle="display-cat"></a></li>
<?php /*} */ ?>
<?php if( osc_users_enabled() ) { ?>
<?php if( osc_is_web_user_logged_in() ) { ?>
<li class="first logged">
<span><?php echo sprintf(__('Hi %s', 'bender_black'), osc_logged_user_name() . '!'); ?> &middot;</span>
<strong><a href="<?php echo osc_user_dashboard_url[); ?>"><?php _e('My account', 'bender_black'); ?></a></strong> &middot;
<a href="<?php echo osc_user_logout_u rl(); ?>"><?php _e('Logout', 'bender_black'); ?></a>
</li>
<?php } else { ?>
<li><a id="login_open" href="<?php echo osc_user_login_u rl(); ?>"><?php _e('Login', 'bender_black') ; ?></a></li>
<?php if(osc_user_registration_enabled()) { ?>
<li><a href="<?php echo osc_register_account_u rl() ; ?>"><?php _e('Register for a free account', 'bender_black'); ?></a></li>
<?php }; ?>
<?php } ?>
<?php } ?>
<?php if( osc_users_enabled() || ( !osc_users_enabled() && !osc_reg_user_post() )) { ?>
<li class="publish"><a href="<?php echo osc_item_post_url_in_category() ; ?>"><?php _e("Publish your ad for free", 'bender_black');?></a></li>
<?php } ?>
</ul>
</div>

<?php /* if( osc_is_home_page() || osc_is_static_page() || osc_is_contact_page() ) { */ ?>
<?php if( 1 == 1 ) { ?>
<form action="<?php echo osc_base_u rl(true); ?>" method="get" class="search nocsrf" <?php /* onsubmit="javascript:return doSearch();"*/ ?>>
<input type="hidden" name="page" value="search"/>
<div class="main-search">
<div class="cell">
<input type="text" name="sPattern" id="query" class="input-text" value="" placeholder="<?php echo osc_esc_html(__(osc_get_preference('keyword_placeholder', 'bender_black'), 'bender_black')); ?>" />
</div>
<?php if ( osc_count_categories() ) { ?>
<div class="cell selector">
<?php osc_categories_select('sCategory', null, __('Select a category', 'bender_black')) ; ?>
</div>
<div class="cell reset-padding">
<?php } else { ?>
<div class="cell">
<?php } ?>
<button class="ui-button ui-button-big js-submit"><?php _e("Search", 'bender_black'];?></button>
</div>
</div>
<div id="message-seach"></div>
</form>
<?php } ?>
</div>

<?php osc_show_widgets('header'); ?>

<div class="wrapper wrapper-flash">

<nav id="nav-main">
<ul>
<li> <a href="index.php?page=search&sCategory=4"><?php _e("Rooms","bender_black");?></a> </li>
<li> <a href="index.php?page=search&sCategory=6"><?php _e("Electronics","bender_black");?></a></li>
<li> <a href="index.php?page=search&sCategory=2"><?php _e("Vehicles","bender_black");?></a></li>
<li> <a href="index.php?page=search&sCategory=3"><?php _e("Books","bender_black");?></a></li>
<li> <a href="index.php?page=search&sCategory=8"><?php _e("Clothes","bender_black");?></a></li>
<li> <a href="index.php?page=search&sCategory=5"><?php _e("Services","bender_black");?></a></li>
<li> <a href="index.php?page=search&sCategory=1"><?php _e("General","bender_black");?></a></li>
</ul>
</nav>
<div id="nav-trigger">
<span><?php _e("Categories","bender_black");?></span>
</div>
<nav id="nav-mobile"></nav>

<?php echo osc_get_preference('homepage-728x90', 'bender_black'); ?> <!---- MOVED THIS ADs SECTION FROM LINE 31 TO HERE ----->


<?php
$breadcrumb = osc_breadcrumb('&raquo;', false, get_breadcrumb_lang());
if( $breadcrumb !== '') { ?>
<div class="breadcrumb">
<?php echo $breadcrumb; ?>
<div class="clear"></div>
</div>
<?php
}
?>
<?php osc_show_flash_message(); ?>
</div>
<?php osc_run_hook('before-content'); ?>
<div class="wrapper" id="content">
<?php osc_run_hook('before-main'); ?>
<div id="main">
<!-- this line lists all categories on main page <?php osc_run_hook('inside-main'); ?> --->


这可能是由于与页面上的其他JavaScript冲突造成的。打开错误控制台(Linux和Windows上Firefox中的Ctrl+Shift+J)或开发人员工具(F12→ 控制台)并检查是否有任何JavaScript错误显示在那里。我想你有什么发现。听了你的建议后,我犯了以下错误
错误:缺少必需的参数:sitekey
我将编辑原始帖子,以显示错误消息Anywhere?错误表明您的Recaptcha配置不正确,站点密钥设置不正确。我不知道如何配置Recaptcha,我从未使用过它。你可能想问另一个问题。(但是,在您询问其他问题之前,请确保此错误不会出现在“联系人”页面上。如果出现,则表示这不是问题所在。)此错误也会出现在“联系人”页面上,因此问题似乎与Recaptcha无关。
<li class="cat"><a class="ico-menu icons" data-bclass-toggle="display-cat"></a></li>
<?php /*} 
      */ 
?>