js import | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

js import

how to include my .js file in sololearn?

9th May 2018, 9:46 AM
梅云飞
梅云飞 - avatar
6 Answers
+ 2
"Ulisses Cruz", how do you put my name as reference in your comment
9th May 2018, 10:27 AM
Dmitriy
Dmitriy - avatar
0
<script src='http://yoursite.com/same_path/your_js_script.js'> in head section of html or by creating DOM element 'script' with src='http://yoursite.com/same_path/your_js_script.js'
9th May 2018, 9:57 AM
Dmitriy
Dmitriy - avatar
0
梅云飞 what Dmitriy said will work if your .js file is online and you have an url to it. But if that is not the case: 1. Copy the source code to the JS section of Playground. . If you clicked the '+' in the code playground and chose 'Web' you will see that the screen will have 4 tabs: (HTML, CSS, JS and OUTPUT) put your code in the JS section. 2. Put your code inside a <script> tag in the HTML section. Hope this helps : )
9th May 2018, 10:19 AM
Ulisses Cruz
Ulisses Cruz - avatar
0
3ks, but i want to use some common utils in sololearn. thus, i can import it by <script> when i create new project in playground
9th May 2018, 10:22 AM
梅云飞
梅云飞 - avatar
0
梅云飞 I did not understand what you mean.
9th May 2018, 10:23 AM
Ulisses Cruz
Ulisses Cruz - avatar
0
If you have the last Sololearn Update you can just type the @ character, a list of names will apear. I did this I chose your name in the list.
9th May 2018, 10:30 AM
Ulisses Cruz
Ulisses Cruz - avatar