1. What is a Web?
The World Wide Web is commonly known as the Web.
It is an interconnected system of public web pages accessible through the Internet.
It allows documents to be connected to other documents through hypertext links like a spider web.
2. What is Client-Side Rendering and Server-Side Rendering?
Client-Side Rendering:
Client-Side Rendering means rendering pages directly in the browser using JavaScript.
All logic, data fetching and routing are handled on the client rather than the server.
When the browser requests the server, the response would be a bare-bones HTML document with a JavaScript file that will render the rest of the site using the browser.
Server-Side Rendering:
Server-Side Rendering means rendering pages on the server.
All logic, data fetching and routing are handled on the server rather than the client.
When the browser requests the server, the response would be fully rendered HTML.
3. What is CORS?
CORS stands for Cross-Origin Resource Sharing.
It allows a website to make requests to another website in the browser.
There are two types of CORS requests.
Simple Requests:
When the browser is requesting another domain/ website, the browser adds an
When a server sees this header and wants to allow access, it needs to add an
When the browser sees this response with an appropriate
Preflight Requests:
When the browser is making a complex HTTP request, the browser adds a preflight request.
Complex Requests include:
- Requests that use methods other than GET,POST, orHEAD
- Requests that includes headers other than Accept,Accept-LanguageorContent-Language
- Requests that have a Content-Typeheader other thanapplication/x-www-form-urlencoded,multipart/form-data, ortext/plain
Browsers create automatically a preflight request if it is needed. It is an OPTIONS request like below and is sent before the actual request.
The server analyzes the preflight request to check if this origin has access to do such a method. If yes, the server returns all methods the origin is permitted to use and indicates that you can send the original request. If not, the original request is ignored.
4. What is the use of crossorigin="anonymous"?
The
With the HTML
5. How do you inform the user if an error occurs in the code?
If an error occurs in the code, we can inform the user in different ways.
Some of them are:
alert
DOM Manipulations
6. How to check whether the website is working properly?
Some of the things to ensure whether the website is working properly or not are:
UI:
Check the UI is as expected and is responsive on different devices.
If we need to display the UI after API calls,
Check whether the API response is expected or not.
We can check it by Inspecting and clicking the Network tab. Check the HTTP status and fix the errors. Errors might be due to a mistake in the URL, network connection etc.
We can check if there are any errors in the JS code by console tab and fix the errors like reference errors, etc.
Functionality:
Interact with the website and check whether the functionality is as expected by inspecting and checking the errors, API responses, etc.
Performance:
We can check the performance of the website through
7. How to check whether the website is working properly in all browsers?
We can check whether the website is working properly in all browsers using the different services.
8. What are the different Frameworks?
Some of the frameworks are:
- Bootstrap
- Angular
- Flutter, etc.
9. How to write a dummy API call?
We can create a fake API call using the fake API services like JSONPlaceholder, reqres, postman, etc.
For more details, please refer to the below links:
- https://jsonplaceholder.typicode.com/
- https://mocki.io/docs
- https://reqres.in/
- https://learning.postman.com/docs/getting-started/introduction/
10. What is Web Hosting and How can you host a website?
Web Hosting is an online service that enables you to publish a website on the Internet.
Web Host allocates some space for your website in their server. It stores all the files and data necessary for your website to work properly.
When the user accesses your website, the web host transfers all the files necessary for the website.
We can host a website using different web hosting providers like Nexcess, Godaddy, etc.