JavaScript

JavaScript is the scripting language used in web browsers. The name JavaScript is often used in place of the proper name ECMAScript, JavaScript actually being the Mozilla Foundation's implementation of the ECMAScript standard. JavaScript as a client-side technology is fully supported by DreamHost.

About JavaScript
JavaScript is a dynamic, weakly typed, prototype-based language with first class functions. JavaScript was influenced by many languages and was designed to have a similar look to Java, but be easier for non-programmers to work with. The language is best known for its use in websites (as client-side JavaScript), but is also used to enable scripting access to objects embedded in other applications.

Despite the name, JavaScript is only distantly related to the Java programming language, the main similarity being the common debt to the C syntax.


 * Source: Wikipedia article on "JavaScript". Used in accordance with the GFDL.

JavaScript at DreamHost
The extra web security feature, or mod_security, can cause POST requests generated by XMLHttpRequest objects to receive HTTP 503 response codes from the server. This is because mod_security checks for the presence of a correct Content-Length header. To prevent this, make sure Content-Length is set correctly before making the request:

server = new XMLHttpRequest; //Firefox style creation server.onreadystatechange = server_sent_response; dummystring = "whatever=0"; //mod_security chokes on sending a blank string too. server.open("POST", location, 1); //assumes location set to a URL server.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); server.setRequestHeader("Content-length", dummystring.length); server.setRequestHeader("Connection", "close"); server.send(dummystring);

Related articles

 * AJAX
 * Java - Related only in name.