EDIT : @Mike 'Pomax' Kamermans, sorry about the link shortners, you're absolutely right!
I have added a datepicker to a form on my website but it is only working when i browse directly to the page, for example if you open the first link directly (Reservation Page) the datepicker should work properly (that means that there is no errors in the code i just added).
But if you browse to the index page first (Link 2) and THEN click on Reservation, the page is loaded using page.js librairie and it seems my code isn't executed !
Here is the relevant part of the code placed just before the closing body tag on my reservation.html page :
<script src="./plugin/components/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="./plugin/components/bootstrap-datepicker/locales/bootstrap-datepicker.fr.min.js"></script>
<script src="./plugin/components/moment/moment.min.js"></script>
<script src="./plugin/components/TouchSwipe/jquery.touchSwipe.min.js"></script>
<script src="./plugin/datepicker-in-fullscreen.js"></script>
<script>
$('#date').datepickerInFullscreen({
fakeInput : false,
format : 'DD/MM/YYYY',
effect : '16',
template : ' <div class="datepicker-in-fullscreen-modal dpifs-inverted-colors"> ' +
' <div class="datepicker-in-fullscreen-content"> ' +
' <div class="datepicker-in-fullscreen"></div> ' +
' <div class="datepicker-in-fullscreen-controls"> ' +
' <a class="dpifs-today">{{today}}</a><a class="dpifs-clear">{{clear}}</a><a class="dpifs-close">{{close}}</a> ' +
' </div> ' +
' </div> ' +
' </div> '+
' <div class="datepicker-in-fullscreen-background dpifs-inverted-colors"></div> ',
datepicker : {
daysOfWeekDisabled: [0],
language : 'fr'
}
});
</script>
<script>
var cleave = new Cleave('#phone', { phone: true, phoneRegionCode: 'fr' });
</script>
Only solution for now is to refresh the page to have the datepicker working..
Why is my JS not executed ? And what is the proper way to add custom js file in this case ?
Thanks a lot for all of you who read all of topic!