07-27-2008, 05:48 AM
|
#5 (permalink)
|
|
The Wanderer
Join Date: Jun 2008
Posts: 5
Thanks: 1
|
Quote:
Originally Posted by ryanmr
If he's already using a library, there is no reason to reinvent the wheel!
|
In this case there is, because a lot of ajax libraries are extremely heavily coded, and if it's such a simple job like this, better to just use your own. Also, he did say in his post "standalone"...
By the way, to make it even lighter and still usable in all modern browsers you could even downsize to this
Code:
<script type="text/javascript">
function regenerate() {
var ajax;
ajax = new XMLHttpRequest();
ajax.onreadystatechange=function() {
if(ajax.readyState==4) {
document.getElementById("string").innerHTML=ajax.responseText;
}
}
ajax.open("GET","gen.php",true);
ajax.send(null);
}
</script>
|
|
|
|