欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  资讯频道

Dojo 1.3和Plugd一起发布

程序员文章站 2022-05-08 21:36:45
...
今天Dojo 1.3发布了,提供了一些有用的API:

// create a div.

var n = dojo.create("div");

// create a div with content and styles

var n = dojo.create("div", { innerHTML:"hi!", style:{ height:"200px" } });

// destroy the node safely

dojo.destroy(n);

// place an anchor somewhere, before the node with id="someNodeId"

var a = dojo.create("a", { href:"http://dojotoolkit.org" }, "someNodeId", "before");

// empty the contents of a node safely:

dojo.empty("someNodeId");

dojo.query(".nodes").empty();

// place a new LI in an UL at the first position

dojo.place("<li>Newly created DOM Node</li>", "someUl", "first");

// complex creation in dojo.query. passes through dojo.place

dojo.query("myNode").addContent("hi there!", "first");

 



同时还发布了Plugd,一个非常酷的插件,能够作为一个独立的dojo.js的替代。

你能这样写代码:

$("p.baz")

    .appendTo("body")

    .addClass("bar")

    .onclick(function(e){

       e.target.innerHTML = "Wow, JavaScript";

    });



发布详情查看:http://www.dojotoolkit.org/2009/03/31/dojo-1-3-now-available
相关标签: Dojo