2016-10-06 2 views
0

Ich versuche Bootstrap-Kollaps wie this zu verwenden, aber es hat nicht vollständig funktioniert (der Text nicht nach dem zweiten Klick zurückfallen).Duplicate CDN Abbrechen Funktionen

Ich habe versucht, eine der loacl CDN-Skripte zu entfernen und dann funktioniert es. (Die Zeile ist markiert)

Ich habe die 'Datatable' von heruntergeladen, weil ich die "Suche" in meine Sprache übersetzen wollte. Mit dem normalen CDN funktioniert es super.

Warum passiert das?

<!DOCTYPE html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 


    <!--The problem row--> 
    <script type="text/javascript" src="DataTables/datatables.js"></script> 


    <!-- jQuery --> 

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> 
    <script type="text/javascript" src="/path/to/jquery-latest.js"></script> 
    <script type="text/javascript" src="/path/to/jquery.tablesorter.js"></script> 

    <!-- Bootstrap --> 

    <!-- Latest compiled and minified CSS --> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 

    <!-- Optional theme --> 
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> 

    <!-- 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> 

    <!-- Toggle --> 
    <link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet"> 
    <script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script> 

    <script src="https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script> 
    <script src="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.js"></script> 



</head> 
<body> 

<div class="container"> 
    <h2>Simple Collapsible</h2> 
    <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#demo">Simple collapsible</button> 
    <div id="demo" class="collapse"> 
    Lorem ipsum dolor sit amet 
    </div> 
</div> 

</body> 
</html> 

Antwort

0

Sie können Datatables für die Übersetzung verwenden. Bei der Initialisierung übergeben Sie die URL der Übersetzung cdn unten im Beispiel oder laden Sie sie herunter und passen Sie sie an Ihre Bedürfnisse an.