View Single Post
Old 07-27-2008, 05:48 AM   #5 (permalink)
Third_Degree
The Wanderer
 
Join Date: Jun 2008
Posts: 5
Thanks: 1
Third_Degree is on a distinguished road
Default

Quote:
Originally Posted by ryanmr View Post
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>
__________________
Tutorials
Third_Degree is offline  
Reply With Quote
The Following User Says Thank You to Third_Degree For This Useful Post:
delayedinsanity (07-27-2008)