External JavaScript file is not getting added when running on Flask

前端 未结 4 866
孤独总比滥情好
孤独总比滥情好 2020-12-07 18:36

I have an HTML file named showMap.html:





  

        
4条回答
  •  天命终不由人
    2020-12-07 19:06

    Serve the map.js file as a static resource:

    • move the file to a static/ subdirectory of your package

    • generate a static URL for it in a Jinja2 template like so:

       
      

    The filename parameter takes a relative path; you can use subdirectories was needed.

提交回复
热议问题