Closed asoiso closed 11 years ago
<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>baiduTemplate</title> <script src="https://raw.github.com/wangxiao/BaiduTemplate/master/baiduTemplate.js"></script> </head> <body> <div id="demo"></div> <script id="demoTemp" type="text/html"> <%=params.title%> <%=data[0].id%> </script> <script> //data放前面,params放后面,解析title报错 var result = { "data": [{"id": 1},{"id": 2}], "params": {"title": "经典"} }; document.getElementById("demo").innerHTML = baidu.template("demoTemp",result); </script> </body> </html>
感谢反馈,这个bug确实很神奇啊,我尽快修复。
新版本中已经修正,之前可能引用的不是最新版。感谢建议。
用了一下,果然好了!