Category Archives: JavaScript & DHTML

Using The Post Method In Ajax

In the Rasmus’ 30 Second Ajax Tutorial, we’re using the get method to send our request: function sndReq(action) { http.open(’get’, ‘rpc.php?action=’+action); http.onreadystatechange = handleResponse; http.send(null); } But what if we want to use the post method? Well, let’s modify that function to do just that: function sndReq(action) { http.open(’post’, ‘rpc.php’, true); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.setRequestHeader("Content-length", action.length); [...]

The textContent and innerText Properties

In my original post, Using the innerText Property in Firefox, I wrote my example using document.all to determine when to use innerText or textContent. Because the main purpose of that post was to explain to the reader that Firefox does not support the innerText property but the textContent property, I failed to consider other browsers… [...]

Multiple Submit Buttons on a Single Form

At some point, people ask themselves “How can I have two submit buttons with different actions in one form?” Well, the approach I’ve used to accomplish this task is to ‘emulate’ the submit buttons with regular button controls and changing the form action based on what button was clicked. In the following example I have [...]

Using the innerText Property in Firefox

I’ve read on different forums questions of people asking how they can make the innerText property work in Firefox. Many have suggested to use the innerHTML property instead, but that would not be useful because, obviously, the HTML tags would be either rendered or displayed (an example of the latter would be if we want [...]

Rasmus’ 30 second AJAX Tutorial

This is a great and simple example/tutorial on AJAX by Rasmus Lerdorf (the creator of PHP). It’s just AWESOME! Rasmus’ 30 second AJAX Tutorial (Original Post @ php-general mailing list)