datetimepicker not work

Hello,
In my database i have a field with datatype DateTime.
When I check on the “Use date/time picker” in the “Edit Tag” tab and then generate all the files,
The field appears as input text without showing the icon calendar on the web page
When I open Inspect on the web page the script code appears like

<script type="c2562e874affc6e7ca3281b7-text/javascript">

loadjs.ready(["fregister", "datetimepicker"], function () {
    let format = y‏/MM‏/dd",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.getPreferredTheme()
            }
        };
    ew.createDateTimePicker("fregister", "x_birthdate", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options, {localization: {locale:'en'}}));
});
</script>

Press [F12] from your browser, and check whether any Javascript error message from Console section.

malik wrote:

There is no such “type” attribute (which is invalid and may prevent the code from being executed) in the original code. Did you try to load the page in an indirect way?

1- In console section there is no any javascript error message.
2-i am loading the page in normal way.
3- And when i execute following script in console section after finished load page it is working and the icon calendar appears

loadjs.ready(["fregister", "datetimepicker"], function () {
    let format = y‏/MM‏/dd",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.getPreferredTheme()
            }
        };
    ew.createDateTimePicker("fregister", "x_birthdate", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options, {localization: {locale:'en'}}));
});

arbei wrote:

There is no such “type” attribute (which is invalid and may prevent the code from being executed) in the original code.

Browsers will ignore scripts with unknown type. If you remove the type, it will work. You need to find out what inserted the invalid type attribute type=“c2562e874affc6e7ca3281b7-text/javascript” into the script. It looks like there is some filter on the web server trying to inject the type attribute to script tags and prevent executing scripts.

This issue appears on the server but locally it works correctly.

following script on server
<script type="7cbb76af46d7482d5064963c-text/javascript">
loadjs.ready(["fregister", "datetimepicker"], function () {
...
});
</script>



following script on local
<script>
loadjs.ready(["fregister", "datetimepicker"], function () {
...
});
</script>

arbei wrote:

It looks like there is some filter on the web server trying to inject the type attribute to script tags and prevent executing scripts.

You better check your web server settings.