Thread Perl + Bootstrap4: Tooltip Problem (18 answers)
Opened by Der-Niko2 at 2018-12-17 00:37

Der-Niko2
 2018-12-17 00:37
#189401 #189401
User since
2018-12-17
7 Artikel
BenutzerIn
[default_avatar]
PERL BOOTSTRAP 4 TOOLTIP PROBLEM (TOOLTIP NEEDS JQUERY AND POPPER JS)

Hi Perl-Community,

I want to use Bootstrap 4 Tooltips within a small perl project. The Tooltips need jQuery and Popper.

For a first test I have taken a basic sample code from "https://www.w3schools.com/bootstrap4/bootstrap_too...". The code works fine within a Html file (test.html). But when I put the code to a Perl file (test.pl) - see below - the Bootstrap 4 Tooltip doesn`t work. I get an error message in the Browser Console: "Uncaught SyntaxError: Invalid or unexpected token"

Could anyone help me? Thanks a lot!

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!"D:\xampp\perl\bin\perl.exe"
use strict;
use warnings;

print <<OUT;
Content-type:text/html

<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container mt-3">
<h3>Tooltip Example</h3>
<p>Tooltips must be initialized with jQuery: select the specified element and call the tooltip() method.</p>
<a href="#" data-toggle="tooltip" title="Hooray!">Hover over me</a>
</div>

<script>
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
</script>

</body>
</html>
OUT


modedit Editiert von GwenDragon: Titel geändert
Last edited: 2018-12-17 10:31:49 +0100 (CET)

View full thread Perl + Bootstrap4: Tooltip Problem