Answer the question
In order to leave comments, you need to log in
jQuery not working on mac os in local html, how to fix it?
How to connect to local page.html jquery file? What would jquery scripts work on a local page
Tried:
- Connect through a file in a folder with page.html
<script type="text/javascript" src="jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.js"></script>
<html>
<head>
<!--Подключаем библиотеку-->
<script type="text/javascript" src="jquery-3.6.0.min.js"></script>
<link rel="stylesheet" href="style2.css">
<script type="text/javascript" src="base2.js"></script>
<meta charset="utf-8">
</head>
<body>
<p class="Zagalovok" >Главная</p>
<title>Главная</title>
<div class="bookmarkList">
<h2>
Bookmark List
</h2>
</div>
<div class="vidBx">
<button class="getTime appp" onclick="javascript:;">click here</button>
<video id="videoElement" autoplay controls width="100%">
<source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
<source src="https://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg">
<p>Your browser does not support the video tag.</p>
</video>
</div>
<BR><BR><BR>
</body>
</html>
var myVid = document.getElementById('videoElement');
$('.getTime').on('click', function() {
var mycurrentTime = myVid.currentTime;
$(".bookmarkList").append("<a href='javascript:;' rel='" + mycurrentTime + "' class='bookmarkLink'>" + mycurrentTime + "sec - Click to Play</a>");
$('.bookmarkList a').click(function() {
myVid.currentTime = $(this).attr('rel');
myVid.play();
});
});
.getTime {
background: #f36e65;
color: #fff;
font-size: 12px;
text-align: center;
padding: 8px 10px;
text-decoration: none;
display: block;
width: 150px;
margin: 0;
font-family: Arial;
text-transform: uppercase;
position: absolute;
top: 0px;
right: 0px;
z-index:9;
}
.bookmarkList {
background: #fff;
color: #111;
padding: 0;
border: 1px solid #f36e65;
margin-bottom: 1em;
font-family: Arial;
font-size: 13px;
}
.bookmarkList a {
display: block;
margin-bottom: 0;
color: #f36e65;
text-decoration: none;
border-bottom: 1px solid #f36e65;
padding: 5px 10px;
}
.vidBx {
position: relative;
}
.bookmarkList h2{text-transform:uppercase; font-weight:normal; font-size:14px; font-family:Arial; color:#fff; background:#f36e65; padding:5px; margin:0;}
.appp{
display:inline-block;
}
Answer the question
In order to leave comments, you need to log in
check where your jquery is, see the browser console, what errors are there
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question