Where does the snippet or Javascript get processed when we enter that in input box of HTML page or any URL?
Does it go to the server and come back or does the browser process it?
Where does the snippet or Javascript get processed when we enter that in input box of HTML page or any URL?
Does it go to the server and come back or does the browser process it?
Does it go to the server and come back or does the browser process it?
Actually, both. When you enter some data in a form field and send it, the server does something with this data (it typically saves it into a database). If the data contains Javascript code, the server doesn't care, it just saves it as if it was normal text (remember that Javascript is a client-side language, the server cannot execute it).
When you want to view this information that has been saved in the database, the server sends the requested data back to the user. This data is handled by the browser, which will care about rendering the webpage. If the requested data contains Javascript code, this will be executed in this moment.
You should first learn, how the browser works... Read this http://taligarsiel.com/Projects/howbrowserswork1.htm