Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1501832
  • 博文数量: 3500
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 43870
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-03 20:31
文章分类

全部博文(3500)

文章存档

2008年(3500)

我的朋友

分类:

2008-05-04 23:28:14

一起学习
前面有人发布过关于Aptana出的jaxer的信息。jaxer号称世界第一个真正的ajax服务器.现在又有人开发了一个Pyxer,是一个基于python的ajax服务器

  主页:

  讨论:

  下载:

Html代码复制代码
  1. "">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <title>Proxy Demotitle>
  6. head>
  7. <body>
  8. <form action="" onSubmit="save_data(document.getElementById('num').value); return false;">
  9. Value between 5 an 50
  10. <input type="text" value="" id="num" onChange="validate(this.value)">
  11. form>
  12. <script language="Python" type="text/python" runat="both">
  13. def validate(value):
  14. value = int(value)
  15. if not (5 <= value <= 50):
  16. alert("Number not in range!")
  17. return False
  18. return True
  19. script>
  20. <script language="Python" type="text/python" runat="server-proxy">
  21. def save_data(value):
  22. file("counter.txt", "w").write(value)
  23. def load_data():
  24. return file("counter.txt", "r").read()
  25. script>
  26. <script language="Python" type="text/python" runat="client">
  27. def onload():
  28. document.getElementById('num').value = load_data()
  29. window.onload = onload
  30. script>
  31. body>
  32. html>

TAG: Ajax AJAX ajax Python

下载本文示例代码


Python AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX ServerPython AJAX Server
阅读(571) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~