日期:2014-05-17  浏览次数:20539 次

这个JS代码冲突了,如何修改?
<script type="text/javascript">
function $(id) { return document.getElementById(id); }

function addLoadEvent(func){
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function(){
oldonload();
func();
}
}
}
//以下代码省略
</script>

====================================

  <script type="text/javascript">
window.onload = function()
{
  var wordinput = document.getElementById("TextBox1");
  wordinput.onfocus = function()
  {
  this.value = "";
  }
  wordinput.onblur = function()
  {
  if(this.value == "")
  {
  this.value = "请输入名称"; }
  }
}
  </script>
============================
请问如何修改?

------解决方案--------------------
或者把下面的这段放到上面代码的前面