Sayfayı Yazdır | Pencereyi Kapat

Templates to jQuery Core

Nereden Yazdırıldığı: Datakent
Kategori: Diğer bölümler
Forum Adı: C# & ASP.NET
Forum Tanımlaması: C# ve ASP.NET ile ilgili soru / sorun ve paylaşım bölümü
URL: http://forum.datakent.com/forum_posts.asp?TID=2253
Tarih: 14.Mayis.2024 Saat 05:18


Konu: Templates to jQuery Core
Mesajı Yazan: murat turan
Konu: Templates to jQuery Core
Mesaj Tarihi: 18.Ekim.2011 Saat 13:42

jQuery ile şablon kullanımına açıklayıcı bir örnek

 
<script type="text/javascript">  
 
jQuery(function(){  
  var products = [  
        { name: "Product 1", price: 12.99},  
        { name: "Product 2", price: 9.99},  
        { name: "Product 3", price: 35.59}  
  ];  
 
  $("ul").append("#template", products);  
});  
</script>  
 
<script id="template" type="text/html">  
    <li>{%= name %} - {%= price %}</li>  
</script>  
 
<ul></ul> 


-------------
http://www.kasatakip.com - Kasa Takip  |  http://www.caritakip.com - Cari Takip  |  http://www.evraktakip.com - Evrak Takip  |  http://www.etasqlmobil.com - ETA SQL Mobil



Sayfayı Yazdır | Pencereyi Kapat