---
title: "网页制作的小技巧"
author: "foohsinglong"
date: "2011-12-08T19:37:19Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2011-12-27T16:10:50Z"
id: 1296572
url: "https://foohsinglong.iteye.com/blog/1296572"
---

```html
让浏览器在保存页面时失败在页面源文件上增加下面一行代码，保存页面时，就会报错误： 
<noscript><iframe src="*.html"></iframe></noscript> 

防止被人frame 或者 iframe 包含我们的页面： 
<script language="javascript">
<!-- if (top.location != self.location) top.location = self.location; //-->
</script> 

脚本出错时，也不提醒 
<script language="javascript">
<!-- function killErrors() { return true;} window.onerror = killErrors; //-->
</script> 

自动显示最后更新时间 
<script language="JavaScript">
<!--hide script from old browsersdocument.write("本页最后更新日期: " + document.lastModified + "")
// end hiding -->
</script>
"document.lastModified” 得到的是文件最后更新时间，这样我们就不用更新文件的时候，再更新对应页面文本了。
```