External JavaScript Not Running, does not write to document

前端 未结 4 1404
我寻月下人不归
我寻月下人不归 2021-01-13 17:14

I\'m trying to use an external JavaScript file in order to write \"Hello World\" into a HTML page.

However for some reason it does not work, I tried the same functio

4条回答
  •  -上瘾入骨i
    2021-01-13 17:28

    You're trying to call the function before it has been loaded.

    Place the load script above the declaration:

    
    
        
    
        
    
    
    
        

    Also you have a typo:

     
    

    Should be:

    
    

    The script type needs to be "text/javascript" not "txt/javascript".

提交回复
热议问题