问题
I am having trouble with my JavaScript module in the Edge browser. In Chrome everything works perfectly. Since my users have both Edge and Chrome available to them, the application has to work in both. In my html head
-section I have:
<script type="module" src="{% static "js/app.js" %}"></script>
The {% static "js/app.js" %}
is a django
template-tag
.
The app.js begins like this:
"use strict";
import { editor } from "./editor.js";
import { homepage } from "./home.js";
import { contactPage } from "./contact.js";
jQuery( window ).on( "load", () =>
{ // code... }
In the inspector network-tab I can see that app.js
, editor.js
, home.js
and contact.js
are loaded with status 200
(OK).
The console gives me:
HTML1406: Invalid start of a tag '<?'
HTML1500: The tag can not be a self-closing tag
Those warnings are generated in an svg-file that starts with <?xml .....
and when I remove that and close the tags in the svg
with a proper closing-tag the problem is NOT solved.
As I said: in chrome everything works fine. I don't know if there is any other code that could be relevant. Maybe anyone else came across this problem. I am clueless.
来源:https://stackoverflow.com/questions/65610984/javascript-module-not-working-in-edge-version-44-make-18-17763