Skip to main content

Posts

Showing posts from February, 2009

The fundamental differences between "GET" and "POST"

The fundamental differences between "GET" and "POST" The HTML specifications technically define the difference between "GET" and "POST" so that former means that form data is to be encoded (by a browser) into a URL while the latter means that the form data is to appear within a message body. But the specifications also give the usage recommendation that the "GET" method should be used when the form processing is "idempotent", and in those cases only. As a simplification, we might say that "GET" is basically for just getting (retrieving) data whereas "POST" may involve anything, like storing or updating data, or ordering a product, or sending E-mail. The HTML 2.0 specification says, in section Form Submission (and the HTML 4.0 specification repeats this with minor stylistic changes): If the processing of a form is idempotent (i.e. it has no lasting observable effect on the state of the world), then the f

Remove/Delete element from page using JavaScript working in FireFox,IE,Opera

Few days ago, I was recalling my Java script skill. I was generating Grid using java script script. Instead of using Display property (’none’ or ‘block’) to show or hide the control, I was creating and removing element each time. Creating element is not a big deal. However the script for removing element is different in IE and Firefox . In IE, we can remove the element using, however this will not work in Firefox . document.getElementById(“ControlID”).removeNode(true); In Firefox , you have to use, var Node1 = document. getElementById (“ ParentControlID ”); Node1.removeChild(Node1.childNodes[0]); Below is the sample code for the same. var Node1 = document. getElementById (“Parent”); var len = Node1.childNodes.length; for(var i = 0; i <> { if(Node1.childNodes[i].id == “Child”) { Node1.removeChild(Node1.childNodes[i]); } } Happy Programming ! Naimish R. Dave