新足迹

 找回密码
 注册

精华好帖回顾

· 8个月的宝宝经过1个月睡眠训练后的成果 (2007-11-22) rosalie · 地产投资问题专贴(悉尼住宅地产) (2007-8-5) Consultant
· 【班长的甜品驿站】炎炎夏日,送上冰镇可口的甜橙果冻~~ (2008-8-27) 炊事班长 · I can't see myself... (2007-1-17) Kingfisher
Advertisement
Advertisement
查看: 1382|回复: 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
返回顶部