新足迹

 找回密码
 注册

精华好帖回顾

· E&E -- 无油无面粉零难度 -- 香橙杏仁蛋糕 (2011-12-12) 闲夏采薇 · TIGUAN 项目竣工了 2012年继续更新 V4.1地图上路.. 第8页 (2011-3-23) morningsun
· 泳池水泵修理记 (2014-12-30) daniello · 【美食接龙】第3棒~ 鱿鱼两吃: 玉环酿&金封碎-接棒食材- 鲜虾- tritri 请接棒啦~ (2009-6-1) 闲夏采薇
Advertisement
Advertisement
查看: 1388|回复: 2

New jQuery plugin from Microsoft [复制链接]

2010年度奖章获得者

发表于 2010-10-6 09:42 |显示全部楼层
此文章由 dalaohu 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 dalaohu 所有!转贴必须注明作者、出处和本声明,并保持内容完整
微軟現在也開始向jquery裡添加新的plugin。

這個jQuery template 是其中的一個, 上次有同學問道,現在有第一方的插件了。

http://stephenwalther.com/blog/a ... osoft-ajax-cdn.aspx

<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>

<style type="text/css">
     
    html {
        background-color:Orange;
    }
     
    #catBox div {
        width:250px;
        height:250px;
        border:solid 1px black;
        background-color:White;
        margin:5px;
        padding:5px;
        float:left;   
    }
     
    #catBox img {
        width:200px;
        height: 200px;   
    }
     
    </style>

</head>
<body>

    <h1>Cat Photos!</h1>

    <div id="catBox"></div>  

    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>

    <script id="catTemplate" type="text/x-jquery-tmpl">
        <div>
            <b>${title}</b>
            <br />
            <img src="${media.m}" />
        </div>
    </script>

    <script type="text/javascript">
        var url = "http://api.flickr.com/services/feeds/groups_pool.gne?id=44124373027@N01&lang=en-us&format=json&jsoncallback=?";

        // Grab some flickr images of cats
        $.getJSON(url, function (data) {
            // Format the data using the catTemplate template
            $("#catTemplate").tmpl(data.items).appendTo("#catBox");
        });

    </script>

</body>



This page displays a list of cats retrieved from Flickr:

评分

参与人数 1积分 +3 收起 理由
乱码 + 3 感谢分享

查看全部评分

足迹 Reader is phenomenal. If you never used, you never lived 火速下载
Advertisement
Advertisement

发表于 2010-10-6 10:06 |显示全部楼层
此文章由 乱码 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 乱码 所有!转贴必须注明作者、出处和本声明,并保持内容完整
ms在open source这方面欠很多,他们正在越来越加大这方面的投入

2007 年度奖章获得者

发表于 2010-10-6 16:10 |显示全部楼层
此文章由 coolioo 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 coolioo 所有!转贴必须注明作者、出处和本声明,并保持内容完整
I need a jQuery string lib

发表回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Advertisement
Advertisement
返回顶部