一行代码将网页分享到QQ、微博等
<ul id="content-share-list" class="bdsharebuttonbox bdshare-button-style0-16"> <li><a class="content_qq" onclick="window.open('http://connect.qq.com/widget/shareqq/index.html?url='+encodeURIComponent(document.location.href));return false;" title="分享到QQ">QQ好友</a></li> <li><a class="content_qqzone" onclick="window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));return false;">QQ空间</a></li> <li><a class="content_weixin" data-cmd="weixin">微信好友</a></li> <li><a class="content_sina" href="javascript:window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.title.substring(0,76))+'&url='+encodeURIComponent(location.href)+'&rcontent=','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0">新浪微博</a></li> </ul> <!-- 点击微信好友生成的二维码 --> <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
一行代码滚动显示本地天气
<iframe name="weather_inc" src="http://i.tianqi.com/index.php?c=code&id=11" width="500" height="15" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" ></iframe>
input框中只能输入非负整数
<input type="text" value="3" maxlength="3" style="width : 30px;text-align: right;" onKeyUp="value=(parseInt((value=value.replace(/D/g,''))==''?'0':value,10))" />