+ 2
How do I link the js file to my html within this app?
I'm not sure how to include link the js file to the HTML page within this app. I know how to normally, is it the same? https://code.sololearn.com/WO6QdFxvwBEH/?ref=app
3 Réponses
+ 2
In SoloLearn, you can either link the script file the standard way if it's hosted (i.e. if I put "daily_web_practice.js" into the address bar of a web browser, it would return content) or copy and paste the entire contents of your script file into the JS tab, which it seems you've already found. 😊
Remember that in SoloLearn, contents in the JS tab run before the HTML document is loaded, so if you want it to run at the end of body, you will have to use another method to defer running the script (like window.onload).
+ 4
awesome thanks
+ 2
You can add JavaScript code on JS part of code playground(web)!!