基于dojo的电子表格控件

今天发现一个利用dojo框架实现的电子表格控件,可以设置字体大小及格式(粗体、斜体、下划线),单元格的背景色、字体颜色,可以实现简单的函数功能,如求合、平均、最大、最小、统计功能。

虽然功能比不上Google SpreadSheets,但对AJAX的Fans来说,又多了一个用dojo的理由 🙂

1.测试地址:
http://www.hopesoft.org/demo/dojo/spreadsheet/spreadsheet.htm

2.界面预览:
spreadsheet

3.官方地址:
介绍Spreadsheet Dojo Widget的官方Blog

4.下载地址:
1.)官方下载
2.)51AJAX.com下载

5.使用方法:
在页面顶部增加对spreadsheet控件的引用


然后在页面中创建spreadsheet控件

10分钟图解ASP.NET AJAX 1.0 RC开发

12月15日,ASP.NET AJAX 1.0 RC版发布,我下载安装试用了一下,没有写一行代码,实现了一个简单的AJAX应用,以下为截图说明。

开发环境:VS2005+ASP.NET AJAX 1.0 RC

首先下载ASP.NET AJAX 1.0 RC安装文件,完成安装后即可进行我们的AJAX之旅了。

1.打开VS2005,点击“新建”-“文件”-“网站”,选择“ASP.Net-AJAX Enabled Web Site”模板,这个模板是我们安装ASP.NET AJAX 1.0 RC后多出来的模板

继续阅读

ASP.NET AJAX 1.0 RC版发布

今天微软发布了ASP.NET AJAX 1.0 RC官方网站的消息如下:

ASP.NET AJAX 1.0 RC has just been released to the Web. New features include additional globalization support, dynamic invocation of web service proxies, and substitution logic, compression and caching support for the Script Resource handler. If you’re transitioning to the RC an application that was built with an earlier “Atlas” CTP or Beta, we’ve provided the following migration guides:

Converting Applications from “Atlas” CTP to ASP.NET AJAX RC
(also available in Word format and in PDF format)

Converting Applications from ASP.NET AJAX Beta 2 to ASP.NET AJAX RC
(also available in Word format and in PDF format)

You’ll also want to know about new features in the RC and changes from the earlier CTPs to the RC. We’ve prepared a detailed whitepaper that describes these changes and how to migrate your applications successfully. Read the Changes between the ASP.NET AJAX (“Atlas”) CTP and the RC and RTM Releases whitepaper which is also available as a Word document and a PDF document.

1.下载地址
http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

2.在线文档
http://ajax.asp.net/docs/Default.aspx

3.相关论坛
http://ajax.asp.net/default.aspx?tabid=47&subtabid=474

4.教学视频
1).Developing ASP.NET 2.0 Applications using AJAX
by Scott Guthrie, General Manager, .NET Development Platform
2).更多视频请点击这里

AJAX案例:Protopage.com

Protopage.com,WEB2.0时代的个人门户。
包括许多模块:天气预报、新闻、相册、播客、视频播客、漫画、Google Maps等等,你可以自定义模块内容,定义桌面背景、模块颜色、标题等等。可以定义标签,以显示不同类型的内容,且标签可以很方便的设置为公开或私有。

目前最新版本是3.0,可访问他们的blog查看更新情况。

以下是截图,具体可访问网站试用,相信你也会惊叹他们的创造的。

1.首页
首页

2.设置主題
设置主题

3.播客
播客

4.视频播客
视频播客

5.我的桌面
我的桌面

6.搜索
搜索

《JavaScript高级编程》学习笔记:优化JavaScript

最近在看《JavaScript高级编程》,摘录一些片断与大家分享。

第19章的第3节:优化JavaScript(P573)

19.3.1 下载时间
Web浏览器下载的是JavaScript源码,也就是所有的长变量与注释都会包含在内。这个因素和其他因素都会增加下载时间,这会增加脚本运行的总时间。增加下载时间的关键因素就是脚本所包含的字节数。

要记住一个关键数字是1160,这是能放入单个TCP-IP包中的字节数。最好能将每个JavaScript文件都保持在1160字节以下以获取最优的下载时间。

在JavaScript中,每个字符就是一个字节,因此,每个额外的字符(不管是变量名、函数名、或者注释)都会影响下载速度。部署JavaScript之前,都应该尽可能优化下载速度。

继续阅读

AJAX案例:gotAPI.com

gotAPI.com,收集了我们在编程、设计中常用到的语言、标准、常用框架、程序集的API,包括html、javascript、CSS、PHP、Java、数据库等等,甚至包括了prototype.js,呵呵。

共有两种方式来查找这些API:

1.http://www.goapi.com

顶部是API的分类,默认有HTML、JavaScript Dom、CSS、PHP,可以添加更多;左侧是API列表,右侧是具体内容。

2.start.gotapi.com
可以对平时经常用到的API进行快速搜索点,搜索时有下拉提示,会自动根据你的输入提示匹配结果。

有保存历史记录功能,查询过的词会出现在页面左上角。

目前支持HTML、CSS、JavaScript/HTML DOM、XML、Druapl CMS、PHP、Ruby/Rails、Python、Perl、Marcomedia、C/C++,Libraries、Databases、Java,且将来会支持更多的API。

gotapi.com

Dojo之路:如何利用Dojo实现Drag and Drop效果

  如今各种使用AJAX技术的站点都实现了Drag and Drop(拖动)效果,利用Dojo框架也可以很方便的实现,相比较其它框架,代码更少,且对浏览器的兼容性支持比较好。

  先看一下效果,以下是51AJAX.com站点首页的效果,其中各个模块是可以任意拖动的:

  

  如何来实现呢?以下是具体步骤。为简单起见,做了一个Drag and Drop的Demo页面:

  

  以下是具体步骤:

  1.html部分
  要实现拖动,首先要有容器,其次要有可拖动的元素。在这里我们设置了三个Div作为容器,ID分别是container1,container2,container3,每个容器中各放置了一个Div作为可拖动元素,它们的class是divdrag。

  2.javascript代码  
  首先在头部加入对dojo.js的引用,然后根据获取class为divdrag的元素,把它们注册为dojo.dnd.HtmlDragSource对象,再将container1,container2,container3注册为三个容器,且指定容器中的可拖动元素可以被拖动到的容器,以上事件封装成一个函数,增加至window.onload事件中。
  

 //引用以下两个dojo包
 dojo.require(“dojo.style”);
 dojo.require(“dojo.dnd.*”);
 
 function init(){
  //利用classname取到元素列表,将其注册为dojo.dnd.HtmlDragSour
  var arr=dojo.html.getElementsByClass(‘divdrag’)
  for(var i=0;i

Dojo推出0.4.0

今天在坛子里,看到有朋友用到了Dojo 0.4.0,遂上Dojo的官网看了下,果然已经推出了0.4.0。

Available for download (Ajax build, others) The 0.4 release contains many exciting new features, a whopping 529 bugs closed, and the initial release of the long-awaited documentation tool, with inline API documentation that will continue to improve with follow-on releases. These improvements will make Dojo appealing to entirely new audiences and will bring Ajax applications to a new level of acceptance as a first-class user environment. Some of the highlights include:

1.dojo.a11y: the foundation for accessibility (a11y), implemented in some of Dojo’s widgets in 0.4 with more to follow in 0.5. Dojo strives to provide keyboard function as well as integration with high-contrast mode and screen readers for the visually impaired.

2.dojo.charting: A charting engine to implement a variety of chart types using vector graphics

3.dojo.gfx: a 2D vector graphics API which renders natively to browsers as SVG or VML

4.dojo.i18n: a follow on to the translation support in 0.3.1, there is now build support for collecting localized resources in a single file as well as support for localized date and time formatting. More formatting types and more localization to come in 0.5.

5.dojo.lfx: major improvements, such as chainable animations

6.dojo.namespaces: support for extensible widget namespaces and an automatic widget manifest loading feature.

7.dojo.widget: new widgets like Clock, FilteringTable, ProgressBar, plus enhancements to Editor2 and the AccordionContainer. Also localization of some widgets, such as DatePicker.

8.AOL’s contribution of a linker for Javascript, not yet integrated into the build.

可以看出修复了不少Bug,增加了很多新的器件,及新的模块,又得学习了,不知稳定性如何,还有待检测。要是实际开发,最好用低一些的版本,因毕竟经过时间检验,bug比较少。