Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript幻灯片无法在多个页面上工作_Javascript_Jquery_Html_Wordpress_Twitter Bootstrap - Fatal编程技术网

Javascript幻灯片无法在多个页面上工作

Javascript幻灯片无法在多个页面上工作,javascript,jquery,html,wordpress,twitter-bootstrap,Javascript,Jquery,Html,Wordpress,Twitter Bootstrap,我有一个来自Twitter Bootstrap 2.3.2文档的javascript驱动的旋转木马,我正在Wordpress主题中使用它 我有两个实例,第一个实例在主页上运行良好,但另一个未能初始化,引用了“TypeError:$不是函数” $(document).ready(函数(){)Firebug中的错误 标题中有我的代码: <!doctype html> <html <?php language_attributes(); ?>> <head&

我有一个来自Twitter Bootstrap 2.3.2文档的javascript驱动的旋转木马,我正在Wordpress主题中使用它

我有两个实例,第一个实例在主页上运行良好,但另一个未能初始化,引用了“TypeError:$不是函数”

$(document).ready(函数(){)Firebug中的错误

标题中有我的代码:

<!doctype html>
<html <?php language_attributes(); ?>>
 <head>
 <meta charset="<?php bloginfo('charset');?>">
 <title><?php
global $page, $paged;
wp_title( '|', true, 'right' );
bloginfo( 'name' );
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
    echo " | $site_description";
if ( $paged >= 2 || $page >= 2 )
    echo ' | ' . sprintf( __( 'Page %s' ), max( $paged, $page ) );
?></title>

<link href="<?php echo get_template_directory_uri(); ?>/css/carousel.css" rel="stylesheet" type="text/css" media="all"/>
<link href="<?php echo get_template_directory_uri(); ?>/css/style.css" rel="stylesheet" type="text/css" media="all">
<script src="wp-content/themes/xxx/js/jquery-1.9.1.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script src="<?php echo get_template_directory_uri(); ?>/js/nav.js"></script>
<script>
var map;
function initialize() {
var mapOptions = {
zoom: 15,
scrollwheel: false,
center: new google.maps.LatLng(13.094297,-59.601735),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map-canvas'),
  mapOptions);
}

google.maps.event.addDomListener(window, 'load', initialize);

</script>
<?php wp_head(); ?>


我认为您没有加载Jquery,您可以检查它是否加载了调试工具吗?
请在chrome中单击F12,查看是否正在加载Jquery消息$基本上不是一个函数,表示它找不到Jquery

我想你没有加载Jquery,你能用调试工具检查它加载了吗?
请在chrome中单击F12,查看是否正在加载Jquery消息$基本上不是一个函数,表示它找不到Jquery

添加一个splash
/
来开始您的链接,如下所示:

<script src="/wp-content/themes/xxx/js/jquery-1.9.1.min.js"></script>

添加一个splash
/
来开始您的链接,如下所示:

<script src="/wp-content/themes/xxx/js/jquery-1.9.1.min.js"></script>

第一个检查是jQuery($)在您的页面中可用

尝试用jQuery替换$

首先检查页面中是否有jQuery($)

use class insted of id for multilple slider at single page

<script type="text/javascript">
$(document).ready(function () {
 $('.myCarousel').carousel();
});
</script> 
尝试用jQuery替换$

在单页使用类代替多页滑块的id
use class insted of id for multilple slider at single page

<script type="text/javascript">
$(document).ready(function () {
 $('.myCarousel').carousel();
});
</script> 
$(文档).ready(函数(){ $('.myCarousel').carousel(); });
在单页上使用类代替多页滑块的id
$(文档).ready(函数(){
$('.myCarousel').carousel();
});

Sorted。我必须用.Works链接到我的js文件,现在就像一个符咒。Sorted。我必须用.Works链接到我的js文件,现在就像一个符咒。