0
說我有一個對象,如:是否可以在Prototype模板中使用複雜的json對象?
{
id: 345,
title: 'Some title',
body: 'Here be a lot of text',
author: {
id: 1
name: Bob
email: [email protected]
}
}
我將如何引用作者的性質在我的模板
例如,
var template = new Template('
<div class='blog_post'>
<h1><a href='/blog/post/#{id}'>#{title}</a></h1>
<div>#{body}</div>
<div><a href="mailto:#{author_email}">#{author_name}</a></div>
</div>
');
赫爾我不知道爲什麼我沒有嘗試點符號馬上。謝謝! (重新:語法,我只是輸入了一個例子,這不是實際的代碼) – JaredM 2010-09-13 18:51:22