prototype学习笔记

自定义的JS部分
/**
	define js code by sheng
*/
 	function axSendMessage() {
 		var url = "testAjax";
 		var param = "name="+ $F("name");
 		
 		var ajax = new Ajax.Request(url, {
 			method:"post",
 			parameters:param,
 			onComplete:callBack,
 			asynchronous:true
 		});
 	}
 	
 	function callBack(content) {
 		var  nameTip = $("nameTip");

 		for(var j = 0; j < nameTip.childNodes.length; j++) {
 			nameTip.removeChild(nameTip.childNodes.item(j));
 		}
 		var c = content.responseText;
 		var list = c.split("~~");
 		for(var i = 0; i < list.length; i++) {
 			var tempDiv = document.createElement("div");
 			tempDiv.innerHTML = list[i];
 			nameTip.appendChild(tempDiv);
 		}
 	}
 	
	new Form.Element.Observer("name", 1, axSendMessage);

你可能感兴趣的:(C++,c,Ajax,prototype,J#)