兼容最新的Firefox/3.1b2的JS调试插件FireBug1.3+下载

昨天搞了一晚上装了几个JS调试插件,都感觉不太好用。最后有得到javaEye一位朋友badqiu的帮助准备装fireBug。今天早早来到公司第一件事就是装上这个插件,因为以前有一个复杂的JS调试不出来,所以准备用工具调试。Ajax的执行路径真让人头疼,东执行一下西执行一下(到处都是alert(),就是跟踪不到错误在哪 )。
  装了好几个都不兼容最新FF,版本兼容一直是开发人员最头疼的问题。下面是我刚刚找到的支持最新FF的地址。
  URL: http://getfirebug.com/releases/firebug/1.4/
  随便附上教程: http://www.ruanyifeng.com/blog/2008/06/firebug_tutorial.html

还有我未调试成功的JS,呵呵
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
 <div id="result"></div>
  <script>
var _timeout;
	function wqwAjax(sendurl,result,type){
		//var _timeout;
		var type=type;
		var result=result;
		createXmlHttpResquest.call(this);
		this.startSend=function(){
			xmlHttp.onreadystatechange = callHandler;
			document.getElementById(result).innerHTML="<font color='green'>"+type+"</font>";//up
			xmlHttp.open("post", sendurl, true);
			xmlHttp.send(null);
		}

		function callHandler(){
			if(xmlHttp.readyState==1){
				circling();
			}
			if(xmlHttp.readyState==4){
				 if(xmlHttp.status==200){
					var value=xmlHttp.responseText;
					stopTimeout();
					document.getElementById(result).innerHTML=value;
				 }
			}
		}
		function circling(){
		
			var resultObj=document.getElementById(result).childNodes[0];
			var resultValue=document.getElementById(result).childNodes[0].innerHTML
			if(resultValue.length<=type.length+3){
				document.getElementById(result).childNodes[0].innerHTML=resultValue+".";
			}else if(resultValue.length>resultObj.length+3){
				document.getElementById(result).childNodes[0].innerHTML=type+".";
			}
			_timeout=setTimeout("circling()",500);
			alert(document.getElementById(result).childNodes[0].innerHTML)
		 }
		 function stopTimeout(){
			clearTimeout(_timeout);
		 }
	   }
  
	  wqwAjax.prototype=new createXmlHttpResquest();
	  function createXmlHttpResquest(){
			this.xmlHttp;
			if (window.XMLHttpRequest) {
				xmlHttp = new XMLHttpRequest();
				if (xmlHttp.overrideMimeType) {
					xmlHttp.overrideMimeType("text/xml");
				}
			} else {
				if (window.ActiveXObject) {
					try {
						xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
					}
					catch (e) {
						try {
							xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
						}
						catch (e) {
						}
					}
				}
			}
	  }
	 var ajax=new wqwAjax("http://www.baidu.com","result","call"); 
	 ajax.startSend();
  </script>
 </BODY>
</HTML>


我的目的是调用var ajax=new wqwAjax("telMeeting.do","result","call");
ajax.startSend();来打电话,发短信等。此JS具有通用功能。由于项目中AJAX用得少,所以没用框架。问了fins胖哥,结果他半天还不知道我的意图。一般的人一运行代码,就应该知道了吧,晕了。

你可能感兴趣的:(jsonp,xml,Ajax,Firebug,firefox)