Web Developer Questions et reponses d'entretien
Question 26. Explain the 'same-origin policy' in the context of web security.
The 'same-origin policy' is a security measure that restricts web pages from making requests to a different domain than the one that served the web page.
Question 27. What is the purpose of the 'cookie' in web development?
Cookies are small pieces of data stored on the client's machine, used to store user information and maintain state between HTTP requests.
Example:
document.cookie = 'username=John; expires=Thu, 18 Dec 2024 12:00:00 UTC; path=/';
Question 28. What is the difference between 'localStorage' and 'sessionStorage'?
'localStorage' stores data with no expiration time, while 'sessionStorage' stores data for the duration of the page session.
Question 29. How does the 'target' attribute work in HTML forms?
The 'target' attribute specifies where to open the linked document when submitting a form, such as '_blank' to open in a new tab.
Example:
Question 30. Explain the concept of 'AJAX Long Polling' in web development.
AJAX Long Polling is a technique where the server holds an HTTP request open until new data is available, allowing real-time updates.
Les plus utiles selon les utilisateurs :