+ 4
Js only add functionality and logic to the site
4th Jun 2019, 4:00 PM
Trinity
+ 6
Mofey What are you attempting to accomplish with your question? The semantics used in your question makes the context ambiguous and therefore difficult to accurately answer. Possible Question Variations: 1. Can a web page be created using only JavaScript files? Assuming we're talking only about static files served by a web server with mime types mapped to corresponding file extensions, then you'll need at least one HTML file for the browser to load the DOM into memory. You could embed the JavaScript in the HTML or load a separate JS file. The JS could then use the DOM API for loading all HTML Elements and manipulating style attributes in memory as required for the web page. This is essentially what ReactJS does. 2. Can a web page be created using only JS without using or knowing HTML or CSS? You could apply most of the answer from #1. Except, rather than building a traditional webpage using HTML Elements, you could work with only the Canvas element and WebGL.
22nd Jun 2019, 9:27 PM
David Carroll
David Carroll - avatar
+ 5
Maybe we need to call a "timeout" on this thread. 😅 I don't know about your web browser, but if I right-click my index.html file and tell it to open with Chrome (or Firefox, etc.), it will render the page, but if I do the same for my index.js file, it will only display the code (much like view-source from the rendered index.html file). Actually, I believe it is incumbent on the web browser to protect users from potentially malicious scripts, so I see it as the browser's responsibility to not allow (or at least make it difficult for) developers to immediately run/render JavaScript files directly upon users accessing a URL (at least not by default). Sometimes browsers do allow this in limited capacity though ( https://en.m.wikipedia.org/wiki/Bookmarklet ), so I guess there are always exceptions. You can generate HTML and CSS with JavaScript, but that's not the same as not using HTML or CSS. More here: https://stackoverflow.com/questions/7717382/executing-a-javascript-file-directly-from-the-browser
6th Jun 2019, 10:30 AM
Janning⭐
Janning⭐ - avatar
+ 4
Yes! possibilities are everywhere.Nothing is impossible! You can do that, since we can create html element with javascript just you have to link the is page with your html file. The most important thing is that you can't make it attractive and beautiful since you need css for doing that.
17th Jun 2019, 5:41 AM
Krish
Krish - avatar
+ 4
Extending on #1: Alternatively, you could change your web server to serve your initial JS file with the text/html mime type with the same minimal HTML described in my original answer. However, I don't think this is what you are asking and it wouldn't make much sense.
22nd Jun 2019, 9:38 PM
David Carroll
David Carroll - avatar
+ 3
Without calling any HTML or CSS element ... I think it is not possible to create a web page
4th Jun 2019, 1:12 PM
Tony Stark
Tony Stark - avatar
+ 2
Mofey no JS can't be used as a standalone file for a webpage
4th Jun 2019, 5:26 PM
Trinity
+ 2
no it is not possible
4th Jun 2019, 9:45 PM
Danyo Joe Crews Kumi Junior
Danyo Joe Crews Kumi Junior - avatar
+ 2
No html is structure so we can't do but we can develope without css
6th Jun 2019, 9:47 AM
Bala Aravind G
+ 1
Umm nooo
4th Jun 2019, 2:45 PM
Yusuf
Yusuf - avatar
+ 1
Proof of concept: https://code.sololearn.com/WGdQhYidZaf6/?ref=app Not so sure about the actual use of this, but at least the text is rendered (tested on Android SoloLearn app)... Basically that's HTML without the tags, without any CSS or JavaScript.
5th Jun 2019, 6:24 PM
::sĐș::
::sĐș:: - avatar