You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ziel: Wird localhost?calendarWeek=10 aufgerufen wird die 10. Kalenderwoche des aktuellen Jahrs geladen und bei localhost?calendarWeek=10&year=2023 entsprechend die 10 KW des Jahres 2023.
Alternativ(wesentlich aufwendiger und kein wirklicher Mehrwert):
JavaScript Code via PHP senden Beispiel:
Diese Zeile in weekly-report.js wird gelöscht:
var globalCalendarWeek = getCalendarWeek();
Dafür bekommt webserver/index.php folgende Logik nachdem JQuery geladen ist, aber bevor weekly-report.js geladen wird:
$calendarWeek= htmlspecialchars($post[calendarweek....
echo "<script>$() {var globalCalendarWeek = " . $calendarWeek . ";}</script>"
Ziel: Wird localhost?calendarWeek=10 aufgerufen wird die 10. Kalenderwoche des aktuellen Jahrs geladen und bei localhost?calendarWeek=10&year=2023 entsprechend die 10 KW des Jahres 2023.
Implementiert werden kann dies mit: https://www.sitepoint.com/get-url-parameters-with-javascript/ und dann entsprechend die globalCalendarWeek Variable setzen und ggf eine globalYear Variable einfügen.
Alternativ(wesentlich aufwendiger und kein wirklicher Mehrwert):
JavaScript Code via PHP senden Beispiel:
Diese Zeile in weekly-report.js wird gelöscht:
var globalCalendarWeek = getCalendarWeek();
Dafür bekommt webserver/index.php folgende Logik nachdem JQuery geladen ist, aber bevor weekly-report.js geladen wird:
$calendarWeek= htmlspecialchars($post[calendarweek....
echo "<script>$() {var globalCalendarWeek = " . $calendarWeek . ";}</script>"
Siehe auch https://stackoverflow.com/a/23740549
The text was updated successfully, but these errors were encountered: