+ 2

How do I group html, css, and js files in folder on a pc desktop so that a browser executes css and js files with html doc?

How do I group html, css, and js files in folder on a pc desktop so that a browser executes css and js files with html doc? I have document file html saved as .html, css as .css, and javascript as .js. All three files are in a folder and files/folder all have same title "demo2." When I access .html file with browser such as Google Chrome the only output I see is the .html without effective .css and/or .js files. How do I combine folder files so browser opens them together as a webpage?

22nd Jan 2018, 6:12 PM
cumulopolar
15 ответов
+ 6
Oh well, I will now explain step by step on how to do it. First do not use notepad, becuase notepad++ is superiour in any way. Okay first create a folder named 'site'. Inside create 3 files. "index.html", "style.css", "script.js". Now go inside of your index.html and code should look like this: <!DOCTYPE html> <html> <head> <title>title</title> <link rel='stylesheet' href='style.css' /> </head> <body> <!-Your html code will go here--> <script type='text/javascript' src='script.js'></script> </body> </html> Now the only thing you need to do is run index.html and the whole thing will be connected
22nd Jan 2018, 8:06 PM
Ice
Ice - avatar
+ 5
create a folder add three files in same folder (html,css,js) example-> page.html , style.css, page.js In html inside head add link and script tags and specify paths open html file in browser
22nd Jan 2018, 6:24 PM
code learner
code learner - avatar
+ 3
@Ice , Yesssssssssssssss!!! Thank You Ice!
22nd Jan 2018, 8:20 PM
cumulopolar
+ 2
@WASP
22nd Jan 2018, 6:15 PM
cumulopolar
+ 2
@Swapnil Srivastava
22nd Jan 2018, 6:16 PM
cumulopolar
+ 2
I know the excitement here is for mobile applications but I would like to try platform conversion for experimental learning.
22nd Jan 2018, 6:18 PM
cumulopolar
+ 2
Thx @Ice and @code learner ! I'm still working on it... not clear on the specifics of the code I'm working on yet but I'm grateful for your help!
22nd Jan 2018, 7:37 PM
cumulopolar
+ 2
I initially tried transposing code from html, css, and js files from working code in Sololearn however using Windows 8, Notepad, Google Chrome, and file Explorer the files were not initially coming together but I'm working on it! I've tried several different approaches but it is still not clear to me.
22nd Jan 2018, 7:43 PM
cumulopolar
+ 2
I'm trying to simply transpose functioning code as it operates via Sololearn app so that it operates via web browser on PC platform without actually needing to connect to an external server. I want the webbrowser to output operational code from a folder on my desktop as it outputs the same operational code using the Sololearn App.
22nd Jan 2018, 7:59 PM
cumulopolar
+ 2
I want to write and test code with web browser offline.
22nd Jan 2018, 8:00 PM
cumulopolar
+ 2
Glad that I helped, good luck with your site! Have fun!
22nd Jan 2018, 8:20 PM
Ice
Ice - avatar
+ 2
#FullyOperational
22nd Jan 2018, 8:21 PM
cumulopolar
+ 1
just as @code learner said. For CSS in head tag put <link rel="stylesheet" href="style.css" /> For JS put the tag near the end of the body <script type="text/javascript" src="script.js"></script>
22nd Jan 2018, 7:02 PM
Ice
Ice - avatar
+ 1
I just made a variation on Sololearn Quiz Code public via my account here.... perhaps you all can help me fill in the blanks. I tried using simply file name extensions without full filepath as location reference and also tried using full filepath as location reference still it is not operational.
22nd Jan 2018, 7:46 PM
cumulopolar
+ 1
Explain everything. Do you want to create a site from your desktop, or you want to create one via sololearn's code playground?
22nd Jan 2018, 7:55 PM
Ice
Ice - avatar