在使用dojo与java交互时,我想在dojo触发ajax的时候像别的框架一样,没有得到数据前出现一个“数据正在加载中..............”,或者是加载一个动态的图片,不知道该怎么实现,这是我的代码:
function helloPressed() {
dojo.io.bind({
url:"b.jsp",
method:'POST',
handler:helloCallback,
content:{name:dojo.byId('name').value}
});
}
/**
* helloCallback
* @param {type} type,data,evt
*/
function helloCallback(type,data,evt) {
if(type=='error'){
alert('this is error');
}
else{
dojo.byId("show").innerHTML = data;
}
}
该如何添加呢?????谢谢各位了!!!!!!!!
function helloPressed() {
dojo.io.bind({
url:"b.jsp",
method:'POST',
handler:helloCallback,
content:{name:dojo.byId('name').value}
});
}
/**
* helloCallback
* @param {type} type,data,evt
*/
function helloCallback(type,data,evt) {
if(type=='error'){
alert('this is error');
}
else{
dojo.byId("show").innerHTML = data;
}
}
该如何添加呢?????谢谢各位了!!!!!!!!
解决方案 »
- 帮忙看下这个代码
- sturts中的动态验证问题
- 这个页面中的script无法调用。怎么弄都没反应。是怎么回事
- 在struts中html:select,我已从数据库中取出数据,加到了html:option中了,但我如何动态改变默认选中呢
- 求助:为什么在tomcat中超链接下载会是显示内容而不出现下载提示对话框?
- Struts表单验证问题
- WebLogic7.0那里有下载??
- 各位boss,小弟有一小问题~~~,如何利用制作一个可以发送邮件的网页~~~,答者均有赠分
- htmlunit2.9 新浪微博 登录问题
- 关于如何将Servlet嵌入JSP中的问题
- 打印的乱码问题?请教高手
- history.back的问题
dojo.io.bind({
url:"b.jsp",
method:'POST',
handler:helloCallback,
content:{name:dojo.byId('name').value}
});
}
/**
* helloCallback
* @param {type} type,data,evt
*/
function helloCallback(type,data,evt) {
if(type=='error'){
alert('this is error');
}
else{
dojo.byId("showfont").innerHTML = data;
}
} <div id="showfont">
数据正在加载中。
</div>