0

I'm trying to use Twitters bootstrap dropdown, but when I click on the dropdown toggler (Information), the dropdown doesnt activate and nothing happens.

header.php:

<?php
include('minequery.class.php');
?>
<html>
<head>      
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>    
<LINK REL=StyleSheet HREF="css/bootstrap.css" TYPE="text/css" MEDIA=screen>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/  
bootstrap-dropdown.js"></script>
<script src="js/bootstrap.js" type="text/javascript"></script> 
</head>    
<body>        
<div class="header">            
<a href=""><div id="logo"></div><div id="banner"></div></a>            
<div class="navbar navbar-inverse">
  <div class="navbar-inner">
<ul class="nav">
  <li class="active"><a href="index.php">Home</a></li>
  <li><a href="about.php">About</a></li>
  <li><a href="server.php">Server</a></li>
  <li><a href="http://forums.interitumcraft.com">Forums</a></li>
  <li><a href="downloads.php">Downloads</a></li>
  <li><a href="http://donate.interitumcraft.com">Donate</a></li>
  <li><a href="vote.php">Vote</a></li>
  <li class="dropdown">
  <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  Information
  <b class="caret"></b>
  </a>
  <ul class="dropdown-menu">
    <li><a href="#">Rules</a></li>
    <li><a href="#">Guilds</a></li>
    <li><a href="#">Staff</a></li>
  </ul>
  </li>
 </ul>
  </div>
</div>       
</div>        

index.php

<?php include('header.php'); ?>
<html><head><title>InteritumCraft | Minecraft Guild Server</title></head></html>
<div class="main">            
<h2>Home</h2>            
<div id="content">                
<h3>Announcements</h3> 
<?php
 $con = mysql_connect("localhost","interitu_forums","");
 if (!$con)
   {    
   die('Could not connect: ' . mysql_error());
   }

 mysql_select_db("interitu_forums", $con);

 $result = mysql_query("SELECT * FROM mybb_posts WHERE fid='4' LIMIT 5");

 while($row = mysql_fetch_array($result))
   {
?>
<h4>
<?php echo $row['subject']; ?></h4>
<?php echo(substr($row['message'], 0,500)) . '…'; ?>
<?php
echo $text; ?>
<br />
<i><a style="float: right;" href="http://forums.interitumcraft.com/thread-<?php 
echo $row['tid']; ?>.html">Read On</a></i>      
<?php
}

 mysql_close($con);
 ?>
</div>            
<?php include('sidebar.php'); ?>

Sidebar:

 </div>
 </div>
 <br /><br />
 <div id="footer">
 <p>© Copyright Lewes & Mathias / InteritumCraft 2012. All rights reserved</p>  
 </body>
 </html>

I am using the latest bootstrap with all the features and components. Why wont the dropdown toggle?div id=

5
  • 1
    what error are you getting into error console ? Commented Nov 11, 2012 at 16:29
  • where and what is the error console? Commented Nov 11, 2012 at 16:30
  • check in firefox and there you get error console Commented Nov 11, 2012 at 16:31
  • Timestamp: 11/11/2012 16:33:43 Error: The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol. Commented Nov 11, 2012 at 16:33
  • I tried to use your code, and it seemed like the dropdown works fine using Apache Server. This ASCII error, may be found on Line 23 of index.php. You have a ... text being used as one character. This maybe the error it is referring to above, but not the dropdown. Commented Nov 12, 2012 at 18:30

2 Answers 2

1

You have no need to add directly bootstrap-dropdown.js, because the js file bootstrap.js contain already all jQuery plugins used by bootstrap.

On Chromium 23, use both scripts disable feature without display any error message.

Sign up to request clarification or add additional context in comments.

2 Comments

Then why is the dropdown not working? Have I missed some code out?
Probably include both bootstrap-dropdown.js and bootstrap.js cause conflict.
0

You have to refer the Jquery before you refer the bootstrap js.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.