var req = new Request({  
                             method: 'get',  
                             url: this._url,   
                             onRequest: function() { alert('Request made. Please wait...'); },  
                             onComplete: function(response) { alert('Response: '); }  
                         }).send();  

 换成  alert('ok');可以出来效果。

解决方案 »

  1.   

    var req = new Request({  
                                 method: 'get',  
                                 url: this._url,   
                                 onRequest: function() { alert('Request made. Please wait...'); },  
                                 onComplete: function(response) { alert('Response: '); }  
                             }).send();
    换成alert('ok');
    可以弹出 ok  对话框
      

  2.   

    加载不到数据造成的
    你加alert('ok'); 上这个相当于延时,给了足够的时间加载数据,所以就
    JS frame :: http://localhost:8080/sclBBS/js/mootools-1.2-core-nc.js :: anonymous :: line 3625" data: no
    没有数据?
    3625行?
      

  3.   

    哪一句不能帖?
    chinmo,你可能没理解我意思?
    我是说
    var req = new Request({ 
                                method: 'get', 
                                url: this._url, 
                                onRequest: function() { alert('Request made. Please wait...'); }, 
                                onComplete: function(response) { alert('Response: '); } 
                            }).send();
    换成alert('ok');
    可以弹出 ok  对话框。
    但也提醒了我,是不是当点击事件过来时,Request对象还没有来得及提交url给服务器并处理返回数据,所以出错?
      

  4.   

    你那一块全部换成alert(ok) 当然没有问题了啊 现在问题就是发送参数过去了么?我觉得你的调试是不是有问题,现在你都不知道参数是不是发送过去了 ,然后根据你的参数有没有查到你要的结果集,这2点很重要,这样才能判断你是发送参数出错还是接受数据出错还是发送了参数在获取结果的时候出错了!
      

  5.   

    谢谢楼上提醒,经过精心debug,发现url: this._url,  this._url这个参数没有传过去。
    1.为什么在事件处理过程中不能应用对象的属性。请高手解答。
    改成 url: requrl,    传参的形式就可以了。
    2.现在有一问题,选择下拉框数据后,下拉框不能自动选中。、想加一个onchange事件,但具体如何做,请帮忙。
    我更正后的代码如下:/** 
     * @author 孙程亮 E-mail:[email protected] 
     * @version 创建时间:Sep 12, 2008 10:31:01 AM 
     */
    var AjaxSelect = new Class({
    initialize: function(item,requrl,msg){
     this._url = requrl;
     this._item = item;
     this._msg = msg;
     $(this._item).addEvents({
        'click':function(){
                  var req = new Request({  
                 method: 'get',  
                 url: requrl,   
                 onComplete: function() {
                  var _options = this.response.text.split(",");
                  $(item).length=_options.length;
                  for(var i=0;i<_options.length;i++){
                  $(item).options[i] = new Option(_options[i],_options[i]);
                  }
                  $(msg).innerHTML='';
                 }  
             }).send();  
        },
        'change':function(){
          
        
        }
     });
        }
    });
      

  6.   


    /** 
     * @author 孙程亮 E-mail:[email protected] 
     * @version 创建时间:Sep 12, 2008 10:31:01 AM 
     */
    var AjaxSelect = new Class({
    initialize: function(item,requrl,msg){
              var req = new Request({  
                 method: 'get',  
                 url: requrl,   
                 onComplete: function() {
                  var _options = this.response.text.split(",");
                  $(item).length=_options.length;
                  for(var i=0;i<_options.length;i++){
                  $(item).options[i] = new Option(_options[i],_options[i]);
                  }
                  $(msg).innerHTML='';
                 }  
             }).send();  
        }
    });