In file second.js, I want to call a function A from first.js ? How to import ? I tried to import like import a module( export function in first.js) but it didnt work. Thanks
            Asked
            
        
        
            Active
            
        
            Viewed 42 times
        
    0
            
            
        - 
                    4Please edit this question to include what you tried. – danh Sep 25 '19 at 02:54
- 
                    1Can you please more specific about your case and do provide some code part ? – amrs-tech Sep 25 '19 at 02:54
- 
                    Please share your code so we know how to debug it – Kenzo-kun Sep 25 '19 at 03:01
- 
                    I found your answer in this https://stackoverflow.com/questions/950087/how-do-i-include-a-javascript-file-in-another-javascript-file – Ravi Makwana Sep 25 '19 at 04:13
- 
                    I found your answer in this https://stackoverflow.com/questions/950087/how-do-i-include-a-javascript-file-in-another-javascript-file – Ravi Makwana Sep 25 '19 at 04:15
1 Answers
0
            
            
        If you are using a browser environment then you should include the scripts with the attribute type = "module"
Eg.
<script type="module" src="app.js"></script>
 
    
    
        Winston Jude
        
- 569
- 2
- 11
