+ 2
Writing JS on SoloLearn
SoloLearn divides the web languages into unique tabs. I’m a little confused because when I run the document.write in the script tags inside the html tab it works. Like so: <body> <script> Document.write(“”) </script> </body> But also if I just type document.write() in the JS it works. What is the best practice? And what is obtainable on different IDE out there. I use notepad++
3 Respostas
+ 1
JAVASCRIPT IS A SCRIPTING LANGUAGE USED TO PROVIDE BETTER FUNCTIONALITY TO A WEBPAGE
IT IS ALSO USED FOR CLIENT SIDE SCRIPTING OR VALIDATION
IT IS AN OBJECT BASED PROGRAMMING LANGUAGE
JAVASCRIPT CAN BE CREATED IN TWO WAYS
1 INTERNAL JAVASCRIPT
2EXTERNAL JAVASCRIPT
INTERNAL JAVASCRIPT
=================
1st way
<script type=“text/javascript”>
</script>
2nd Way
<script language=“javascript”>
</script>
NOTE: THE INTERNAL JAVASCRIPT MUST BE EMBEDDED IN HTML I.E EITHER HEAD SECTION OR BODY SECTION
EXTERNAL JAVASCRIPT
==================
THE SCRIPT IS CREATED OUTSIDE AND EMBEDDED INTO HTML
<script src=“filename”>
</script>
IF WE WANT TO PERFORM VALIDATIONS OR STYLES IT IS BETTER TO CREATE SCRIPT TAG IN HEAD
IF WE WANT DO SOME ACTION AT THE TIME OF BROWSER OPENING AND CLOSING IT IS BETTER TO CREATE SCRIPT TAG IN BODY
JAVASCRIPT IS CASE SENITIVE
JAVASCRIPT IS LOOSELY TYPES
THERE ARE SEVERAL MODULES OR APPLICATION DEVELOPED BASED ON JAVASCRIPT
1 ANGULAR JS
2 JQUERY
3 AJAX
4 JSON PARSING
JAVASCRIPT MAKES WEBPAGE RESPONSIVE AND DYNAMIC
JAVASCRIPT IS BEST SCRIPTING AMONG ALL OTHER
IT IS BROWSER INDEPENDENT
JAVASCRIPT IS EASY TO LEARN AND EASY TO IMPLEMENT GRAPHICS 2D AND 3D
+ 3
Best practice is to write JavaScript on separate file and then include it with <script> tag on your HTML page.
Here, on Sololearn you don't need to include JavaScript file because all tabs are already connected.
About IDE, web development is easy to do on any IDE.
What I suggest is use Sublime Text(trending IDE nowadays), or you can use brackets, atom, vs code.
+ 2
‘notepad’ is really not the best tool to write code. My favourite editor for all kind of code is ‘vim’!
might be little tricky to get familiar with that tool, but once you found ‘vimtutor’, you will never ever use any other tool for coding.
btw: if you seriously want to code, use linux!!!