(Continued from previous question...)
113. decodeURI(), encodeURI()
Many characters cannot be sent in a URL, but must be converted to their hex encoding. These functions are used to convert an entire URI (a superset of URL) to and from a format that can be sent via a URI.
var uri = "http://www.google.com/search?q=sonofusion Taleyarkhan"
document.write("Original uri: "+uri);
document.write("<br />encoded: "+encodeURI(uri));
Other Interview Questions
- How to detect the operating system on the client machine?
- How do you target a specific frame from a hyperlink?
- What is a fixed-width table and its advantages?
- Where are cookies actually stored on the hard disk?
- How to set a HTML document's background color?
- What does isNaN function do?
- What is negative infinity?
- In a pop-up browser window, how do you refer to the main browser window that opened it?
- Methods GET and POST in HTML forms - what's the difference?.
- Text From Your Clipboard?
- What does the "Access is Denied" IE error mean?
- What does "1"+2+4 evaluate to?
- What is the difference between RegisterClientScriptBlock and RegisterStartupScript?
- What is the difference between a web-garden and a web-farm?
- What is the difference between an alert box and a confirmation box?
- What is a prompt box?
- How about 2+5+"8"?
- What is the difference between SessionState and ViewState?
- What does the EnableViewStateMac setting in an aspx page do?
- To put a "close window" link on a page ?
- Name the numeric constants representing max,min values
- How do you assign object properties?
- Whatís a way to append a value to an array?
- What is this keyword?
- What does the term sticky session mean in a web-farm scenario? Why would you use a sticky session? What is the potential disadvantage of using a sticky session?
- You have an ASP.NET web application running on a web-farm that does not use sticky sessions - so the requests for a session are not guaranteed to be served the same machine. Occasionally, the users get error message Validation of viewstate MAC failed. What could be one reason that is causing this error?
- How to select an element by id and swapping an image ?
- What is the difference between undefined value and null value?
- What are undefined and undeclared variables?
- What is === operator ?
- How to find the selected radio button immediately using the 'this' variable?
- How to find radio button selection when a form is submitted?
- How to disable an HTML object
- To write messages to the screen without using "document.write()" ?
- How to Add new elements dynamically.
- How to have the status line update when the mouse goes over a link (The support of the status line is sporadic)?
- How to create a popup warning box
- How to create a confirmation box?
- How to create an input box?
- How to open a window with no toolbar, but with the location object.
- How to setting a cookie with the contents of a textbox ?
- How to getting values from cookies to set widgets?
- How to Handle Event Handlers?
- How to remove the event listener:
- How to change style on an element?
- How to make elements invisible
- How to set the cursor to wait.
- How to reload the current page
- What does the delete operator do?
- What does break and continue statements do?
- How to create a function using function constructor?
- unescape(), escape()
- decodeURI(), encodeURI()