本站首页    管理页面    写新日志    退出


«August 2025»
12
3456789
10111213141516
17181920212223
24252627282930
31


公告
 本博客在此声明所有文章均为转摘,只做资料收集使用。

我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:
日志总数:1304
评论数量:2242
留言数量:5
访问次数:7585286
建立时间:2006年5月29日




[DWR(Ajax)]DWR中提供XML的传递方法
软件技术,  电脑与网络

lhwork 发表于 2006/7/3 11:39:52

自己用dom4j,所以用dom4j做例子;java server:method(){ return Document 类型;}没有dom4j的例子,借用xom的例子:Element div = new Element("div");Document doc = new Document(div);div.addAttribute(new Attribute("id", "parentXOM"));div.appendChild("This is text from XOMDemo. ");Element button = new Element("input");button.addAttribute(new Attribute("id", "buttonXOM"));button.addAttribute(new Attribute("type", "button"));button.addAttribute(new Attribute("value", text));button.addAttribute(new Attribute("onclick", "alert('Events are enabled')"));div.appendChild(button);return doc;看懂了吧,都是html标签.javascript cliend:验证是否有dom4j的支持(有没有相关的api) DOM4J.getDocument("textDOM4J", function(data) { DWRUtil.setValue("replyDOM4J", data); DOM4J.debugDocument($("replyDOM4J"), function(data) { if (data < 30 || data > 40) { failure("DOM4J reply fail: " + data); } else { success(); } }); }); 调用方法:function getDOM4JDocument(){ var text = DWRUtil.getValue("textDOM4J"); DOM4J.getDocument(handleGetDOM4JDocument, text);}function handleGetDOM4JDocument(data){ DWRUtil.setValue("replyDOM4J", data);}好了.呵呵


阅读全文(3573) | 回复(1) | 编辑 | 精华
 


回复:DWR中提供XML的传递方法
软件技术,  电脑与网络

itstarting(游客)发表评论于2006/9/9 23:35:04

莫名其妙,想发表就不要在英文原文上断章取义 拜托


个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
 


» 1 »

发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.047 second(s), page refreshed 144766138 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号