I've tried the solution from 'Select2() is not a function' but I still can't figure where the problem is..I got this warning in my console & I don't know is it related to the problem or not
A cookie associated with a cross-site resource at http://cloudflare.com/ was set without the
SameSite
attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=None
andSecure
. You can review cookies in developer
<html>
<head>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-1.12.3.js" integrity="sha256-1XMpEtA4eKXNNpXcJ1pmMPs8JV+nwLdEqwiJeCQEkyc=" crossorigin="anonymous"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.1/js/select2.min.js"></script>
<script src="/assets/newDailyDetail.js"></script>
<link rel="stylesheet" href="/css/new.css">
<link rel="stylesheet" href="/css/css/bootstrap.min.css">
</head>
<body>
<select class="browser-default custom-select" name="childId" id="childName">
<option disabled selected>Select the Child..</option>
<% child.forEach((childItem) => { %>
<option value="<%= childItem.childId %>">
<%=childItem.childName %>
</option>
<% }) %>
</select>
<script type="text/javascript">
$(document).ready(function() {
$('#childName').select2({
})
})
</script>
</body>
</html>
SameSite
attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=None
andSecure
. You can review cookies in developer tools under Application>Storage>Cookies and see more details at chromestatus.com/feature/5088147346030592 and chromestatus.com/feature/5633521622188032.