Ошибка при получении: Uncaught TypeError: undefined не является функцией bootstrap.js: 29 (анонимная функция) bootstrap.js: 29 (анонимная функция)
Я получаю следующую ошибку
Uncaught TypeError: undefined is not a function bootstrap.js:29
(anonymous function) bootstrap.js:29
(anonymous function)
на моей странице visualforce
в консоли разработчика. Я пытаюсь интегрировать twitter-bootstrap
в visualforce
Вот полный код визуальной силы
<apex:page standardStylesheets="false" showHeader="false" sidebar="false">
<!-- Begin Default Content REMOVE THIS -->
<head>
<apex:stylesheet value="{!URLFOR($Resource.bootstrap, 'bootstrap/css/bootstrap.css')}"
/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"
type="text/javascript"></script>
<apex:stylesheet value="{!URLFOR($Resource.bootstrap, 'bootstrap/css/bootstrap.min.css')}"
/>
<apex:includeScript value="{!URLFOR($Resource.bootstrap, 'bootstrap/js/bootstrap.js')}"
/>
<apex:includeScript value="{!URLFOR($Resource.bootstrap, 'bootstrap/js/bootstrap.min.js')}"
/>
</head>
<body>
<div id="force">
<div class="input-append" align="center" style="padding-top:20px;">
<input type="text" name="q" class="span2 search-query" placeholder="Snipp or Tag"
/>
<button type="submit" class="btn">Search</button>
<div class="pull-right">
<button class="btn btn-primary active"><i class="icon-white icon-plus"></i> A</button>
kjhkjdfgdgdfgdfgdfgdfgdgfgdfg
<button class="btn btn-primary active"
style="margin-right:50px;"><i class="icon-white icon-bullhorn"></i> Fee</button>
</div>
</div>
</div>
</body>
</apex:page>
Вот ссылка на страницу jady-developer-edition.ap1.force.com
Может кто-нибудь пролить свет на то, что может быть неправильно.
Ответы
Ответ 1
Вам нужно включить jquery перед включением jst файла bootstrap.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="/resource/1358914798000/bootstrap/bootstrap/js/bootstrap.js"></script>
обратите внимание, что вам не нужны как bootstrap.js, так и bootstrap.min.js
Ответ 2
Это может быть вызвано, если вы включили bootstrap.js
до jquery.js
.
Поэтому убедитесь, что вы включили jQuery
до bootstrap
.
Проверить другие вещи.
Также возможен еще один возможный случай: могут быть несколько экземпляров jQuery на странице. Поэтому выполните поиск дублированной версии jQuery и удалите их, если они есть.
Найдите ссылку ниже для получения дополнительной информации.
Предотвращение конфликтов с другими библиотеками