Monday, February 8, 2010

Methods GET vs. POST in HTML forms.

Encoding form data into URL is needed by the GET method. The form data is to be appeared within the message body , by the POST method. By specification, GET is used basically for retrieving data where as POST is used for data storing, data updating, ordering a product or even e-mailing.

JavaScript - Methods GET vs. POST in HTML forms

The GET method in the HTML forms passes the form values by setting the URL.

Eg: If you type the word ‘Hello’ in Google Search, it sets the following URL:

http://www.google.co.in/search?hl=en&q=hello&btnG=Search&meta=&aq=f&oq=

The POST method sends the data to the server without setting the URL:

Eg:
-----------------------------97891525516423
Content-Disposition: form-data; name="username"

aaaa
-----------------------------97891525516423
Content-Disposition: form-data; name="password"

bbbbb12345
-----------------------------97891525516423
Content-Disposition: form-data; name="submit"

Submit
-----------------------------97891525516423--

JavaScript - What does the EnableViewStateMac setting in an aspx page do? -

Opening Browser Windows using JavaScript

newWindowObj = window.open("URL", "WindowName", " EnableViewStateMac setting is a security measure in ASP.Net. It ensures the view state for a page not to tamper. To to so “ EnableViewStateMac=true “is used. ASP.net detects the change in the value of view state sent to the browser when Postback action takes place and raises an error – “Validation of view state MAC failed”.

JavaScript - What does the EnableViewStateMac setting in an aspx page do?

EnableViewStateMac is a security measure used by ASP.NET in order to ensure that the viewstate for a page has not been tampered with.

ASP.NET raises an error (Validation of viewstate MAC failed) if it detects that there has been a change in the value of viewstate that was sent to the browser.

JavaScript - What are windows object and navigator object in JavaScript? -

Windows object is top level object in Java script. It contains several other objects such as, document, history, location, name, menu bar etc., in itself. Window object is the global object for Java script that is written at client-side.

Information pertaining to the client browser and system is returned by the navigator object of JavaScript. Navigator object is the top level object for all users.

JavaScript - What are windows object and navigator object in JavaScript?

The details of the client browser can be obtained sing JavaScript. Details such as client name, version, codename and the platform can be obtained.
navigator.appName - Gives the name of the browser
navigator.appVersion - Gives the browser version
navigator.appCodeName - Gives the browser codename
navigator.platform - Gives the platform on which the browser is running
The JavaScript Window Object is the top level JavaScript object which corresponds to the web browser window.

feature, feature, feature ... ");
features - A comma separated list of features that allow you to customize the appearance of the window

How to detect the operating system on the client machine in JavaScript?

The navigator.appVersion string should be used to find the name of the operating system on the client machine. The following code snippet returns the appropriate Operating systems.

var OSName="Unknown OS";
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";

How to detect the operating system on the client machine in JavaScript?

navigator.platform returns the platform on which the browser is running< /P>

No comments:

Post a Comment