onclick or inline script isn't working in extension

前端 未结 5 1111
渐次进展
渐次进展 2020-11-21 04:57

This seems to be the easiest thing to do, but it\'s just not working. In a normal browser the .html and .js files works perfectly, but in the Chrome/Firefox extension the

5条回答
  •  太阳男子
    2020-11-21 05:20

    I decide to publish my example that I used in my case. I tried to replace content in div using a script. My problem was that Chrome did not recognized / did not run that script.

    In more detail What I wanted to do: To click on a link, and that link to "read" an external html file, that it will be loaded in a div section.

    • I found out that by placing the script before the DIV with ID that was called, the script did not work.
    • If the script was in another DIV, also it does not work
    • The script must be coded using document.addEventListener('DOMContentLoaded', function() as it was told

          
           loving   
      
              
          
      
        
      "here is loaded the external html file when the loving link will be clicked. "

提交回复
热议问题