日期:2014-05-16 浏览次数:20458 次
$name $title
#foreach($i in $test)
$i.name
#end
<html>
<head>
<script type='text/javascript'>
window.onload = function() {
var reg = /^(?:\$
------解决方案--------------------
#foreach).*(?:\n+
------解决方案--------------------
\r
------解决方案--------------------
\))$
------解决方案--------------------
#end/g;
var str = "";
var div = document.getElementById('str');
str = div.innerHTML;
var b = reg.test(str);
alert(b);
}
</script>
</head>
<body>
<div id='str'>
$name $title
#foreach($i in $test)
$i.name
#end
</div>
</body>
</html>