File: ajax.html

Recommend this page to a friend!
  Classes of amani  >  PHP Password Generate  >  ajax.html  >  Download  
File: ajax.html
Role: Auxiliary data
Content type: text/plain
Description: ajax example of password generate class
Class: PHP Password Generate
Generate random password text of given length
Author: By
Last change:
Date: 6 years ago
Size: 1,364 bytes



Class file image Download
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>password generate</title>

<script type="text/javascript">


//Browser Support Code
function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;

	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			// Write received password from ajax request to div
			document.getElementById("result").innerHTML = ajaxRequest.responseText;
	}"GET", "PassGenerate.php?len=20", true);


	<a class="get_pass" onclick="ajaxFunction()">Click to Get New Password</a><br />
	<div id="result"></div>

For more information send a message to info at phpclasses dot org.