我后面可能有一些extjs的前端应用发包,可是怎么解决本地ajax的问题呢?

ThisFellow 2010-02-08 11:18:18
我有个项目,谈下来后准备再向外发包,我想表现层以外的东西全都自己做,那部分东西交流起来麻烦。
但是把页面都拿出来发包。页面全部用extjs开发,网速不是问题。
可是我不想把服务器对兼职者开放,而只是想给他们若干种测试用的json文件或者ajax用html结果文件。
希望他们在本地,直接编辑页面,但是extjs中很多autoload 、ajax的地方不支持file//,有什么简单的解决办法么?
...全文
72 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lin364653705 2010-02-09
  • 打赏
  • 举报
回复

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>树测试</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css"
href="../ext/resources/css/ext-all.css">
<!--
<link rel="stylesheet" type="text/css"
href="../ext/resources/css/xtheme-darkgray.css">
-->
<link rel="stylesheet" type="text/css" href="../ext/ext-patch.css">
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript"
src="../ext/build/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
var tree = new Ext.tree.TreePanel({
el:'tree',
animate:true,
autoScroll:true,

loader: new Ext.tree.TreeLoader({dataUrl: '1.txt'}), //直接加载TXT文件

enableDD:true,
containerScroll: true,
dropConfig: {appendOnly:true}
});

// set the root node
var root = new Ext.tree.AsyncTreeNode({
text: 'Ext JS',
draggable:false, // disable root node dragging
id:'source'
});
tree.setRootNode(root);

// render the tree
tree.render();

root.expand(false,false);
});
</script>
<body>
<div id="tree" style="height:300px;"></div>
</body>
</html>


1.txt内容
[
{text:'01',children:[
{text:'01-01',leaf:true},
{text:'01-02',children:[
{text:'01-02-01',leaf:true},
{text:'01-02-02',leaf:true}
]},
{text:'01-03',leaf:true}
]},
{text:'02',leaf:true}
]


昨天写了一个树的测试页面,以前没有测试过!竟然可以直接解析1.txt的json,在tomcat中测试了下,通过!这样看的话,楼主的问题应该不是问题
ThisFellow 2010-02-09
  • 打赏
  • 举报
回复
不知道是不是可以通过自己实现一个ext.data.proxy来实现呢?
Go 旅城通票 2010-02-09
  • 打赏
  • 举报
回复
你提供功能页给他们,让他们自己写代理页面获取你功能函数的返回值,不过这样会加重别人的任务
KK3K2005 2010-02-09
  • 打赏
  • 举报
回复
只要给发包的人提供明确的接口就可以了
也就是JSON格式和 访问地址
他们怎么调试不用你费心了

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧