anchor click modalni ochmaydi

Mana, men bilan bog'langan yorliq bor.

terms and conditions

Mening modal quyoshga o'xshaydi

<!-- Modal -->
 <div class="modal fade" id="modalTC" role="dialog">
  <div class="modal-dialog">
   <!-- Modal content-->
    <div class="modal-content">
     <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">× </button>
      
    </div>
    <div class="modal-body">
      
Some text in the modal. </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div>

Fiddle.

Nima sodir bo'layotganiga amin emasman. PS: Men bilan bog'liq fayllar mavjud. ya'ni. Bootstrap va Jquery.

6
Yomon shodlik. Rahmatli bolalar. @charlietfl Ah, lekin agar bu erda bo'lsa, odamlar natsistlar bo'lishga urinmasliklari kerak.
qo'shib qo'ydi muallif Suraj, manba
Demak, siz yomon savollarni qabul qilishimiz kerak bo'lgan xatolarni qidirmoqdamiz. Javob bergan har bir kishi konsolda xatolarga qaradi. Nemis siyosati bu erda nima bilan shug'ullanish kerak?
qo'shib qo'ydi muallif charlietfl, manba
Buni tekshiring: jQuery (min.) Js va bootstrap. (Min.) Js . 2-savolni tekshiring: Muammolarni skripka bilan qayta tuza olasizmi? 3-chi betni tekshiring: Agar muammo sizning sahifangizda boshqa ssenariy bo'lsa, sekin urish bilan bog'lab turiladi va u bootstrap.js hodisasi oldidan voqeni bekor qiladi yoki noto'g'ri qaytadi.
qo'shib qo'ydi muallif Andrei Gheorghiu, manba
Konsolni tekshirdingizmi?
qo'shib qo'ydi muallif rahulsm, manba
Muammoingizni sizning sahifangizda jQuery J-ga yo'naltirishni unutganingizni topdim. Konsolingizni tekshiring
qo'shib qo'ydi muallif Ghanshyam Singh, manba

8 javoblar

Hamma narsa yaxshi ishlaydi. Buni ko'ring:

terms and conditions

Ish fiddle

Menimcha, JS va CSS-ni qo'shishni unutgansiz.

1
qo'shib qo'ydi

Make sure you're calling bootstrap.min.js after jquery.min.js

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel=stylesheet href=https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css>

terms and conditions


<!-- Modal -->
 <div class="modal fade" id="modalTC" role="dialog">
  <div class="modal-dialog">
   <!-- Modal content-->
    <div class="modal-content">
     <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">× </button>
      
    </div>
    <div class="modal-body">
      
Some text in the modal. </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div>
</div> </div>

1
qo'shib qo'ydi

Bootstrap va jQuery qo'shganingizga ishonchingiz komilmi? Men qo'shgandim

<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

va u yaxshi ishlaydi

0
qo'shib qo'ydi

JQuery'dan oldin bootstrap yuklaysiz.

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
terms and conditions


<!-- Modal -->
 <div class="modal fade" id="modalTC" role="dialog">
  <div class="modal-dialog">
   <!-- Modal content-->
    <div class="modal-content">
     <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">× </button>
      
    </div>
    <div class="modal-body">
      
Some text in the modal. </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div>
</div> </div>

0
qo'shib qo'ydi

Buni ishlatib ko'ring

 Launch demo modal 

OR refer this .. https://getbootstrap.com/javascript/#modals

jquery-ni yuklash kerakligini yodda tutish kerak bo'lgan yana bir narsadir.

0
qo'shib qo'ydi

Avval jQuery-ga qo'ng'iroq qilish kerak (bootstrap.min.js avval):

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

Working fiddle

Umid qilamanki yordam beradi.

0
qo'shib qo'ydi

You have to include jQuery file before bootstrap.js. here is you fiddle updated: jsfiddle.net/dssoft32/ehmepvya/2/

Bootstrap framework jquery'ga bog'liq. Shunday qilib, avval jQuery ni qo'shishingiz kerak. fayllarni import qilish tartibi java skriptida katta rol o'ynaydi.

0
qo'shib qo'ydi

Ushbu koddan foydalaning va bootstrap.min.css, jquery.min.js, bootstrap.min.js uchta faylni mahalliy sifatida qo'shing.

<!DOCTYPE HTML>

  <head>
    <title>Bootstrap Example</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="stylesheet" href="css/bootstrap.min.css">
      <script src="js/jquery.min.js"></script>
      <script src="js/bootstrap.min.js"></script>
  </head>
  <body>
    <div class="container">
      

Modal Example

      <!-- Trigger the modal with a button -->
      terms and conditions
     <!-- Modal -->
     <div class="modal fade" id="modalTC" role="dialog">
      <div class="modal-dialog">
       <!-- Modal content-->
        <div class="modal-content">
         <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">× </button>
          
        </div>
        <div class="modal-body">
          
Some text in the modal. </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </div> </body> </html>

مور

0
qo'shib qo'ydi
"Ushbu kodni ishlatish" hech narsa izoh qilmaydi
qo'shib qo'ydi muallif charlietfl, manba
Yuqorida aytilganidek, uchta faylni qo'shing.
qo'shib qo'ydi muallif KiranPurbey, manba
kod yaxshi. Faqat jis va CSS fayli qo'shishni unutib qo'yishingiz mumkin. Mahalliy saqlangan JS va CSS fayllaridan foydalaning.
qo'shib qo'ydi muallif KiranPurbey, manba