Web Developer perguntas e respostas de entrevista
Pergunta 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.
Pergunta 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=/';
Pergunta 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.
Pergunta 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:
Pergunta 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.
Mais uteis segundo os usuarios: