Web development learning thread(Javascript, HTML, CSS, angular, vue.js).

Hello All,

After getting inspired from Neo, I have started a bit of JS learning these days. Whenever I learn something I will try to post it here(as of now my learning is NOT exactly bookish where I am going chapter by chapter etc, it could be more like small-small project vice kind of), I would like to request you all to correct me if I am wrong somewhere, any improvements or discussions are welcome.

GOAL of this post(creation of a simple UI): For basic learning I have gone for my college project :slight_smile: where I had created almost 10 years back a "Student registration form", I tried to build it here. UI's goal is to get information from new students who are willing to join any college and if any detail is missing it should alert student, once all details are done it should show as a message to Student(Keeping it simple as of now).

Prerequisites before starting creating UI:

1- Download Visual studio code software from net first.

2- Now install an extension named "Live server:" in it.

3- Now create a folder your machine, in my case I had created "js learning".

4- Use open folder option in Visual code studio and select newly created folder there.

5- Now create your html and js files(mentioned in further description) in same folder in Visual studio code.

Coding part comes now: Before we start coding I would like to mention(which most of the people know), html is a markup language in which for doing dynamic kind of stuff we need scripting language where JS comes. So we will be creating UI in html and then data fields validation parts we will handle by JS.

  • Create HTML code file for UI:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Student registration form.</title>
<script type="text/javascript" src="validate.js"></script>
</head>
<body>
  <form action="#" name="StudentRegistration" onSubmit="return(validate());">

<table cellpadding="2" width="100%" bgcolor="#ADD8E6" align="center"
  cellspacing="2">

<tr>
  <td colspan=2>
  <center><font size=4><b>Student Registration Form</b></font></center>
  </td>
</tr>


<tr>
  <td>Name</td>
  <td><input type=text name=textnames id="textname" size="30"></td>
</tr>


<tr>
  <td>Father Name</td>
  <td><input type="text" name="fathername" id="fathername"
  size="30"></td>
</tr>

<tr>
  <td>Mother Name</td>
  <td><input type="text" name="mothername" id="mothername"
  size="30">
  </td>
</tr>

<tr>
  <td>Postal Address</td>
  <td><input type="text" name="paddress" id="paddress" size="30"></td>
</tr>


<tr>
 <td>Personal Address</td>
 <td><input type="text" name="personaladdress"  
 id="personaladdress" size="30"></td>
</tr>


<tr>
  <td>Sex</td>
  <td><input type="radio" name="sex" value="male" size="10">Male
  <input type="radio" name="sex" value="Female" size="10">Female</td>
</tr>


<tr>
  <td>City</td>
  <td>
      <select name="City">
        <option value="-1" selected>select..</option>
        <option value="New Delhi">NEW DELHI</option>
        <option value="Mumbai">MUMBAI</option>
        <option value="Goa">GOA</option>
        <option value="Patna">PATNA</option>
      </select>
  </td>
</tr>


<tr>
  <td>Course</td>
  <td>
      <select name="Course">
         <option value="-1" selected>select..</option>
         <option value="B.Tech">B.TECH</option>
         <option value="MCA">MCA</option>
         <option value="MBA">MBA</option>
         <option value="BCA">BCA</option>
      </select>
  </td>
  </tr>


<tr>
  <td>District</td>
  <td><select name="District">
  <option value="-1" selected>select..</option>
  <option value="Nalanda">NALANDA</option>
  <option value="UP">UP</option>
  <option value="Goa">GOA</option>
  <option value="Patna">PATNA</option>
  </select>
  </td>
</tr>

<tr>
<td>State</td>
<td>
  <select Name="State">
     <option value="-1" selected>select..</option>
     <option value="New Delhi">NEW DELHI</option>
     <option value="Mumbai">MUMBAI</option>
     <option value="Goa">GOA</option>
     <option value="Bihar">BIHAR</option>
  </select>
</td>
</tr>

<tr>
    <td>PinCode</td>
    <td><input type="text" name="pincode" id="pincode" size="30"></td>
</tr>

<tr>
    <td>EmailId</td>
    <td><input type="text" name="emailid" id="emailid" size="30"></td>
</tr>

<tr>
    <td>DOB</td>
    <td><input type="text" name="dob" id="dob" size="30"></td>
</tr>

<tr>
    <td>MobileNo</td>
    <td><input type="text" name="mobileno" id="mobileno" size="30"></td>
</tr>
<tr>
    <td><input type="reset"></td>
    <td colspan="2">
     <td colspan="2"><input type="submit" value="Submit Form" /></td>
    </td>
</tr>
</table>
</form>

</body>
</html>

I believe most of the people have read html so I will only touch upon its functions.

Brief explanation of HTML file:

1- Basic structure of html file:

<html>
<head>
......................more statements here...........
</head>
<body>
.......UI's components etc here.......
</body>
</html>

2- JS will be placed inside <head> tags like:

<script type="text/javascript" src="validate.js"></script>

Either we could write a different js file with js code and call it here in <script type> here or we could write JS code in here itself, I am taking first approach keeping JS file separate and calling it in HTML file.

3- Few more explanations:
<table> as Name suggests table tag is for creation of table on UI.
<form> ,is to create forms on UI.
<tr> , is for inserting a line in Table.
<td> , is for inserting a cell in line of table, it should be always in <tr> .
input type , will define which kind of input type we have on UI eg--> text box, radio button, drop down menu etc etc.

4- Basically we have created a form and inside it created a table with few rows and columns which will have text boxes, radio buttons etc to gather details from user who is using UI.

Now comes the JS part: HTML will create UI for us but it can not validate data for us, for that purpose I have created a js file which will make sure user is NOT leaving any field empty.

function validate() {
	//This is a js function to validate all the functions of UI.
	var form = document.getElementById("StudentRegistration");
	
	if(document.StudentRegistration.textnames.value==""){
		alert('Please provide your Name! This is a mandatory field can not be empty!!');
		document.StudentRegistration.textnames.focus();
		return false;
	}

	if(document.StudentRegistration.mothername.value==""){
		alert('Please do enter your Mother name, it can not be empty.');
		document.StudentRegistration.mothername.focus();
		return false;
	}
	
	
	if(document.StudentRegistration.fathername.value==""){
		alert('Please enter your father name details:');
		document.StudentRegistration.fathername.focus();
		return false;
	}
	
	if(document.StudentRegistration.paddress.value==""){
		alert('Please enter your address as it is a mandatory field.');
		document.StudentRegistration.paddress.focus();
		return false;
	}
	
	if(document.StudentRegistration.personaladdress.value==""){
		alert('Please enter your email id as it is mandatory field of form:' );
	    document.StudentRegistration.personaladdress.focus();
	    return false;
	}
	
	if ( ( StudentRegistration.sex[0].checked == false ) && ( StudentRegistration.sex[1].checked == false ) ){
		alert('Please enter your gender details, you can not leave this option empty:');
		return false;
	}
    
	if(document.StudentRegistration.City.value=="-1"){
    	alert('Please select city details, you can not leave it empty.');
    	return false;
    }
    
    if(document.StudentRegistration.Course.value=="-1"){
    	alert('Please select course details, it can not be empty in form.');
        return false;
    }

    if(document.StudentRegistration.District.value=="-1"){
    	alert('Please select your district out of the list.');
        return false;
    }

    if(document.StudentRegistration.State.value=="-1"){
    	alert('Please select your State details as it is mandatory for form.');
        return false;
    }

    if(document.StudentRegistration.pincode.value==""){
    	alert('Please do enter your PIN code details.');
        return false;
    }
    

    if(document.StudentRegistration.emailid.value==""){
    	alert('Please do enter your email id as it can not be empty.');
         return false;
    }
    
    if(document.StudentRegistration.dob.value==""){
    	alert('Please do enter your D.O.B(Date of Birth) as it can not be empty.');
        return false;
    }

    if(document.StudentRegistration.mobileno.value==""){
    	alert('You can not leave Mobile number field empty, please enter 10 digits number in form.');
    	return false;
    }
      
}

Explanation on JS code:

1- Created a function in js named validate , which will be called on submit button hit(though I have not completed it yet).

2- Mainly checking conditions that each field should have values.

	if(document.StudentRegistration.textnames.value==""){

In above statement taking value from FORM whose name is "StudentRegistration" then taking its specific item's(input type=text)'s name and checking its value if it is EQUAL to NULL then:

alert('Please provide your Name! This is a mandatory field can not be empty!!');

Using alert to get a message for user to fill that field.

document.StudentRegistration.textnames.focus();

Above statement .focus takes cursor to the mentioned field so user need NOT to move cursor/mouse to missing field.

Like that I have done for all fields.

Here is how UI will look like:

Here is how user will be prompted for entering values in UI:

Any suggestions are welcome, I will post more learning here.

PS: Off course lot of googling I did for this very first post, references were taken(few links mentioned in post) and from roseindia site(I did make some changes in js and html parts).

Thanks,
R. Singh

2 Likes

LOL,

If you were inspired my me Ravinder, you would not use Eclipse to develop a Javascript web app.

Eclipse is a poor choice for a modern IDE for Javascript web app development. Most web developers use Visual Studio Code, Sublime or Atom. I use VSC, personally speaking.

Eclipse is for more for Java developers, not Javascript web developers, in my view. Almost all "2019 web dev tutorials" use VSC. I have never seen one, even by accident, which uses Eclipse, in over two years.

Bottom Line: I would never do this kind of JS web development in Eclipse, Ravinder.

1 Like

Thanks Neo for suggestions, I have installed "Visual studio code" now and have run code there, changed prerequisites instructions in my post too.

Thanks,
R. Singh

1 Like

Welcome to 2019 web dev, Ravinder.

This will serve you very well when you move pass the JS, HTML and CSS basics and move on to node.js and vue.js and other useful JS libs (and SASS) as you become more creative.

1 Like

Hello All,

I learnt today, how to create a button in HTML, how to present OK or CANCEL button for user and after user's selection how to print date and time on screen.

Here is simple HTML file:

<html>
    <head>
        <title>Get date and time once more....</title>
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
        <script type="text/javascript" src="print_date.js"></script>
    </head>
    <body>
        <button onclick="gettime()">Get date and time</button>
        <p id="get_date"></p>
    </body>
</html>

Here is the respective JS file:

function gettime () {
    var txt;
    if(confirm("Press a button")){
        var nDate = Date();
        var dDate = nDate.toLocaleString();
        txt = dDate;
    }
    else {
        txt = "Sorry !! since you pressed CANCEL, so no date and time printing here :)"
    }
    document.getElementById("get_date").innerHTML = txt;
}

What code does:

1- HTML code mentions JS file named print_date.js in it in <script> TAG.
2- It also has a button with button tag, with is value(what it will be shown in text form on button and its id(how we will call it in further program)).
3- We have a <p id=get_date>..</p in our code for paragraph too.
4- Button has something called gettime() function which is called whenever a click happens on button by mentioning onclick="gettime"
5- Now comes JS part, we have a function in JS named "gettime" which will help us to present pop up window for user.
6- confirm("Press a button") condition shows a pop up with OK and CANCEL options in front of client/user.
7- If condition is TRUE when a user hits OK and will create date object's variable and save my locale machine's date and time in txt variable.
8- Else condition, means when user selected CANCEL option then assigning txt variable value as an error.
9- Now finally using document.getElementById("get_date").inneHTML toassign value of txt variable to p tag in HTML file.
10- Now HIT http://localhost:5000/my_html.html link in browser.

I am very tired and almost sleeping so will add screen shots of this too tomorrow,see ya.
Will try to add more small small learning here.

Thanks,
R. Singh

Hi Ravinder,

It's good to learn basic HTML, Plain Vanilla Javascript and CSS before moving on to JS libs and frameworks like Vue.js.

However, you should try to master the basics soon and move to developing in node.js and Vue.js sooner than later.

Also, if you are going to keep working with the very bare bones, at least consider working with Bootstrap classes.

Cheers and Keep Learning!

1 Like

Hello All,

Here is what I learnt today location.replace , what is does is; when someone hits a button, we could re-direct our current page to any other URL/site/page. Codes are as follows for it.

HTML code(re-locate_page.html):

<html>
    <head>
        <title>redirecting url example!!</title>
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
        <script type="text/javascript" src="re-locate_page.js"></script>
    </head>
    <body>
        <p><h1>Click following button to redirect to new link!!</h1></p>
        <button id="button1" onclick="myfunction()">Click here to move to new page!!</button>
    </body>
</html>

JS code(re-locate_page.js):

function myfunction (){
    location.replace("https://www.unix.com/")
}

When I hit URL(http://localhost:5500/re-locate_page.html there will be a button named "lick here to move to new page!!" and when we hit it, it redirects us to UNIX.com

Explanation: Explanation would be simple, a function named myfunction is being called when someone hits button, in function(which is in JS file) location.replace is responsible for redirecting page to newly mentioned page/address.

Still have 1 more hour energy in me, could try to post some more(may be Ajax call sample example).

NOTE: This thread is for learning; since I am newbie in JS and not learning from book(which I mentioned in very first post too), this is not a sequential kind of learning, it is only references which someone could take it. Once I get good hands on I may post small projects etc then on forums.

Thanks,
R. Singh

You could also do location="whatever"; which might avoid confusion with the generic string operator .replace() which works very differently, doing substitutions inside a string.

1 Like

I generally use location='' like Corona688 suggested and not location.replace() . You might also consider location.href='' which tend to use as well.

The main difference between location.href and location.replace() is that replace() removes the URL of the current document from the document history, so then it is not possible to use the "back" button to navigate back to the original document. There are reasons for this method as well.

If you want to erase the prior location history, then consider location.replace()

2 Likes

Ravinder, you can also think about it like this:

window.location.href = '' simulates a mouse click

window.location.replace() simulates an HTTP redirect

Hope this helps.

2 Likes

Hey Corona688,

You might want to consider some modern Javascript or Bootstrap CSS framework (any you like) to spruce up your old site:

http://burningsmell.org/

Don't you think that site needs a refresh?

Thanks Corona688 and Neo.

May be bank's net banking sites use it? Just a guess here, usually in my initial days of using net banking I used to do click on back while having an active session in net banking sites, it used to log me out or gives some error(can't remember exact error).

Thanks,
R. Singh

Yes, many sites like banks and other web apps do not want a user clicking on the back button and using that page (for a number of reasons), so in that case, .replace() is often the best.

The CSS could use work, but I don't have much use for javascript on a static site.

1 Like

Hello All,

I have created a very small UI to play with colors filling and clearing them.

What UI has:

  • It has 4 table cells named first, second, third, fourth cell etc.
  • It has 4 buttons below to it.
    i- To color specific cell.
    ii- To clear(remove color) for specific cell.
    iii- To color all cells.
    iv- To clear all cells.

Here comes code now.

HTML code:

<html>
    <head>
        <title>Here is what I am trying to change the color of a cell by htting a BUTTON!!</title>
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
        <script type="text/javascript" src="change_color_of_cell.js"></script>
    </head>
    <body>
        <table border="1" cellpadding="10" cellspacing="0">
            <tr>
                <td>first cell</td>
                <td>second cell</td>
            </tr>
            <tr>
                <td>third cell</td>
                <td>fourth cell</td>
            </tr>
        </table>
        <p>
            Enter value to color:<input type="text" id="textbox" value="">
            <input type="button" value="Color this cell" onclick="color()" />
            <br><br>
            Enter value to clear color:<input type="text" id="textbox1" value="">
            <input type="button" value="clear this cell" onclick="clearit()">
            <br><br>
            <input type="button" value="color all cells" onclick="color_all()">
            <input type="button" value="clear all cells" onclick="clear_all()">
        </p>
    </body>
</html>

JS code:

function get_value(ref){
  if(document.getElementById(ref)){
     var cell_value = document.getElementById(ref).value
     return cell_value;
     //alert("value is "+cell_value)
  }
}

function color(){
    val=get_value('textbox');
    var x = document.getElementsByTagName('td');
    for(i=0;i<x.length;i++) {
        if(val==i){
           x.style.backgroundColor ="blue";
        }
    }
 }
 
 function clearit(){
     val=get_value('textbox1');
     var x = document.getElementsByTagName('td');
     for(i=0;i<x.length;i++) {
        if(val==i){
           x.style.backgroundColor = "";
        }
     }
 }

function color_all(){
    var count = 0;
    var x = document.getElementsByTagName('td');
    for(i=0;i<x.length;i++){
        if(x.style.backgroundColor!=""){
            count++
        }
        x.style.backgroundColor="blue";
    }
    if(count==i){
        alert("Please be aware that all your cells are already filled with color!!")
    }
}

function clear_all(){
    var x = document.getElementsByTagName('td');
    var count = 0;
    for(i=0;i<x.length;i++){
        if(x.style.backgroundColor==""){
          count=count+1;
        }
        x.style.backgroundColor="";
    }
    console.log(count)
    if(count==i){
        alert("Please be aware, NO cell is having color as of now!!")
    }
}

In case anyone wants to run it in their system, I recommend use Visual CODE studio(very very easy to deal with these kind of programs) and create a HTML file with mentioned code above, create a JS file with mentioned above(name should be "change_color_of_cell.js", since I have mentioned that in HTML code) and run it with LIVE server on 5500 default port and go to you browser with hitting link http://localhost:5500/change\_color\_of_cell.html you could play with UI then.

I am rushing to purchase things as of now, will add more CODE explanation and screen shots to this post in sometime too.

JAVA Script, HTML, CSS is really cool :cool:

NOTE: This time less googling and less references taken :slight_smile:

Thanks,
R. Singh

1 Like

Good learning!

Keep learning Ravinder and soon you can dive into Vue.js and write new forum components with me, after you get the basic of CSS and JS down :slight_smile:

I will create a JSON REST API for you and encourage you tp build a Vue app using live forum data :slight_smile:

1 Like

Thanks a TON Neo for encouragement here, fingers crossed, I pray to GOD to give me strength to learn more daily basis.

Hello All,

I created a simple side navigation bar, where all options(hyperlinks) are my own programs itself :slight_smile:

UI's explanation:

  • On left side have 5 links where I can hit on them and go the specific program's UI, I thought I will maintain all my programs into this side bar itself.
  • On main page it is a sample text I have taken from net.

HTML code: HTML code uses very basic things like hre (for page simple redirection to another link), link rel TAG for mentioning CSS file name in it by which we are making page settings like coloring, spacing etc etc. <div>...</div> tag which specifies a specific section in code(AFAIK).

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel = "stylesheet" type = "text/css" href = "all_programs1.css" />
<script type="text/javascript" src="all_programs.js"></script>
</head>
<body>

<div class="sidenav">
  <a href="http://localhost:5500/Change_colors%20of%20cells%20with%20buttons/change_color_of_cell.html">Color cells and clear cells program.</a>
  <a href="http://localhost:5500/Working_ones/create_window.html">Click on button and get alert program.</a>
  <a href="http://localhost:5500/Working_ones/date-time.html">Get date on browser simple program.</a>
  <a href="http://localhost:5500/Working_ones/create_window.html">Get confirm message window program.</a>
  <a href="http://localhost:5500/Working_ones/prompt_user.html">Relocate page program.</a>
</div>

<div class="main">
  <h2>Auto Sidebar</h2>
  <p>This sidebar should handle test contents.</p>
  <p>Scroll down the page to see the result.</p>
  <p>test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test</p>
  <p>test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test</p>
  <p>test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test</p>
  <p>test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test</p>
</div>  
</body>
</html> 

Now here I have first time tested how to import a CSS file into HTML codes. Have created file named "all_programs1.css" where all css code will be there for above html code.

CSS code:

body {
    font-family: "Lato", sans-serif;
  }

.sidenav{
    width: 460px;
    position: fixed;
    z-index: 1;
    top: 20px;
    left: 5px;
    background: #eee;
    padding: 8px 0;
    font-size: 25px;
  }
  
  .sidenav a {
    padding: 6px 8px 20px 16px;
    text-decoration: none;
    color: #2196F3;
    display: block;
  }
  
  .sidenav a:hover {
    color: #16cc35;
  }
  
  .main {
    margin-left: 470px;
    font-size: 28px;
    padding: 0px 10px;
  }
  

A bit explanation on CSS portion is; .sidenav is a class name(for <div> TAG) and I am telling css to have this setting only for that class by using . . In case anyone wants to apply CSS settings for a specific component's ID then use like #sidenav as an example.

their properties are pretty much easy to understand. 1 great feature is hover which means we could set properties FOR ACTION when MOUSE/CURSOR is over some heading/text. In this example I am setting that its color should be GREEN, likewise we could set more things in it.

NOTE: Again few references were taken by googling.

Thanks,
R. Singh

Ravinder,

In this line:

<script type="text/javascript" src="all_programs.js"></script>

the type="text/javascript" attribute is obsolete for a script element (these days), so you can get rid of it.

<script src="all_programs.js"></script>

You must be following an "older" tutorial since it uses obsolete attributes.

Also, since you are developing in Visual Studio Code , you should not use "test test test ... " for dummy data because VSC has emmet or shortcut based lorem ipsum for test data, I think it's builtin but in might be by extension now.

There are many "fun facts" like this to get familiar with and these "fun facts" will greatly speed up your web dev time in the future.

1 Like

Thanks a TON Neo for letting know, yes you are right without <...type="text/javascript" too it is running, will try out options in VSC too thank you.

Here is my very FIRST LOGIN Page program(FAIR Warning: I am NOT dealing with server side as of now so, I had hard coded username and password for test user, learning purposes. Anyone who is following this post, should keep tat in mind that we should follow the BEST practices only and this is a learning thread).

Now comes the code part:

HTML code:

<html>
    <head>
        <title>Login form for Ravinder Singh's applications.</title>
        <meta http-equiv="content-type" content="text/html;charset=utf-8">
        <link rel = "stylesheet" type = "text/css" href = "user_login_page.css" >
        <script src="user_login_form.js"></script>
    </head>
<body>
<h1>Singh application's login form.</h1>
<form>
    <div class="image_container">
        <img src="Log-In-Button2.jpeg" alt="avatar" class="logo_image">
    </div>
    <br><br>
    <div>
        <label for="username"><b>Username:</b></label>
        <input type="text" placeholder="Enter username here to login." id="username" required>
    </div>
    <div>
        <label for="pass"><b>Password:</b></label>
        <input type="password" placeholder="Enter password for user." id="pass" required>
    </div>
    <div>
        <input type="button" id="button1" onclick="get_validated()" value="Login">
    </div>
</form>
</body>
</html>

JS code:

function get_validated (){
    var admin_user="admin";
    var admin_pass = "P@ssw0rd";
    var user_name = document.getElementById('username').value;
    var pass = document.getElementById('pass').value;
    if(!user_name){
    alert('This is a required field, please fill in the user name to Login to Singh App.');
    exit;
    }
    if(!pass){
        alert('Sorry!! but NO ONE can login without a valid password!!');
        exit;
    }
    if(pass!=admin_pass && admin_user==user_name){
        alert('Please enter correct password for admin user!!');
        exit;
    }
    if(pass==admin_pass && admin_user==user_name){
        document.write("You will be redirected to a new page in 2 seconds");
        setTimeout('Redirect()', 2000);   
    }
    /*if(pass==admin_pass && admin_user==user_name){
        alert('Your user name entered is:'+user_name);
        location.replace('http://localhost:5500/Tried_ones/all_programs_UI.html');
        alert('Welcome admin user !!')
    }*/
    
}

function Redirect() 
{  
    //window.location="http://localhost:5500/Tried_ones/all_programs_UI.html"; 
    location.replace('http://localhost:5500/Tried_ones/all_programs_UI.html')
} 

Will add code explanations shortly too.

NOTE: JS part is almost completely written by me and HTML part references from net were taken a bit.

Thanks,
R. Singh

Hi Ravinder,

If you want to start learning to work with server side data, many beginners and expert alike use this site for "fake JSON data"

https://jsonplaceholder.typicode.com/

If you Google for fake JSON data, you will find other sites on the net that offer free APIs to use.

Also, you might also consider starting to use Google's FireStore or Firebase as a good place to store data (free for most users):

https://firebase.google.com/docs/firestore/

Web development is quite advanced now and there are many amazing free tools to help you along the path to be a great web developer.

1 Like