学习小结

<script type="text/javascript">
function fun(){

var new_id=document.createElement('div'); //创建一个图层

//给div设置大小和颜色,通过他的style属性来获得但是设置具体的某个属性还是要根据具体的属性名来设置
new_id.style.width='100px';   //设置长

new_id.style.height='100px';  //设置宽


new_id.style.backgroundColor='blue';//给图层加颜色

new_id.id='div1';//给图层定义一个ID

//确定位置
document.body.appendChild(new_id);//在body里面加入一个子元素new_id

var text=document.createTextNode("^_^^_^^_^");   //创建一个节点

new_id.appendChild(text);   //给new_id加入一个字节点

alert(document.getElementByid('div1').nodeName);//弹出一个消息框,显示的是div1里面的值,也就是^_^^_^^_^

}
</script>
</head>

<body>
<input type="button" onClick="fun()" value="确定">

//<?php
 include('libs/Smarty.class.php');
 $smarty=new Smarty();

 $smarty->caching=true;    //开启缓存

 $smarty->template_dir="demo/templates";
 $smarty->compile_dir="demo/templates_c";

  $smarty->cache_dir="demo/cache";//设置目录

  $smarty->cache_lifetime=30;  //设置缓存的生命周期
 $smarty->left_delimiter="<{";
 $smarty->right_delimiter="}>";
 $smarty->assign("a","Hell World abcdefg");
  $smarty->assign("b",123);
 $smarty->display('capialize.tpl');

?>

<body>
<{$a|change}><br />
<{$a}>--------<{$a|lower}>-------全部小写<br />

<{$a}>--------<{$a|upper}>-------全部大写<br />

<{$a}>--------<{$a|count_characters}>-------不算空格统计字符个数<br />

<{$a}>--------<{$a|cat:"坏人"}>-------cat连接字符<br />

<{$a}>--------<{$a|count_paragraphs}>-------统计段落<br />

<{$a}>--------<{$a|count_sentences}>-------统计句数<br />

<{$a}>--------<{$a|count_words}>-------统计词数<br />

<{$a}>--------<{$a|indent:"4":"&nbsp;"}>-------段落缩进<br />

<{$a}>--------<{$a|replace:$a:"ooxxoo"}>-------替换<br />

<{$a}>--------<{$a|truncate:9:"^":"true"}>-------字符替换<br />

</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值