var req = new Request({
method: 'get',
url: this._url,
onRequest: function() { alert('Request made. Please wait...'); },
onComplete: function(response) { alert('Response: '); }
}).send();
换成 alert('ok');可以出来效果。
method: 'get',
url: this._url,
onRequest: function() { alert('Request made. Please wait...'); },
onComplete: function(response) { alert('Response: '); }
}).send();
换成 alert('ok');可以出来效果。
解决方案 »
- 数组foreach的问题
- 求教
- JS 里 ${..} 怎么判断是否为空啊
- 设置leftmargin影响了onbeforeunload函数
- open和其全屏的问题?
- <!DOCTYPE html> 声明后 鼠标拖动事怪 无效?
- windows98系统的开始——关闭计算机——选择重新启动计算机时回车,却不能正常重启,就是闪了以下又恢复桌面了,请问高手们是怎么一回事
- 好书下载!
- 谢谢大家的指导,那个问题我解决了,用笨的方法把div定位显示了,还有一个问题,学javascript不久想问的是,<a href="javascript:duogao
- 滚动条到底部了,但内容没有显示完
- 求教如何写js组件?
- 一个function里2个却只执行一个?
method: 'get',
url: this._url,
onRequest: function() { alert('Request made. Please wait...'); },
onComplete: function(response) { alert('Response: '); }
}).send();
换成alert('ok');
可以弹出 ok 对话框
你加alert('ok'); 上这个相当于延时,给了足够的时间加载数据,所以就
JS frame :: http://localhost:8080/sclBBS/js/mootools-1.2-core-nc.js :: anonymous :: line 3625" data: no
没有数据?
3625行?
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给服务器并处理返回数据,所以出错?
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(){
}
});
}
});
/**
* @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();
}
});