DRAG DROP
You are developing a form that captures a user’s email address by using HTML5 and jQuery.
The form must capture the email address and return it as a query string parameter. The query string parameter must display the @ symbol that is used in the emailaddress.
You need to implement this functionality.
How should you develop the form? (To answer, drag the appropriate code segment to the correct target or targets in the answer area.
Each code segment may be used once, more than once,or not at all. You may need to drag the split bar between panes or scroll to view content.)
A.
B.
C.
D.
To explain the difference between these two let me explain the difference between encodeURI and encodeURIComponent.
The main difference is that:
encodeURI is intended for use on the full URI.
encodeURIComponent is intended to be used on .. well .. URI components that is any part that lies between separators (; / ? : @ & = + $ , #).
So, in encodeURIComponent these separators are encoded also because they are regarded as text and not special characters.
Now back to the difference between the decode functions, each function decodes strings generated by its corresponding encode counterpart taking care of the semantics of the special characters and their handling.
var str;
str=$(“form”).serialize();
$(“span”).html(decodeURIComponent(str));
A y B
how do you guys judge that it is a full uri or not by looking at this code ?