<script>
var   _madedate="2007-05-15";
var   _madedate1=_madedate.replace(/-/g,   "/");
alert(_madedate1)
</script>

解决方案 »

  1.   

    var   _madedate1=_madedate.replace(/-/g,   "/"); 
      

  2.   

    stringObj.replace(rgExp, replaceText)rgExp 必选项。为包含正则表达式模式或可用标志的正则表达式对象。也可以是 String 对象或文字。如果 rgExp 不是正则表达式对象,它将被转换为字符串,并进行精确的查找;不要尝试将字符串转化为正则表达式。replaceText 必选项。是一个String 对象或字符串文字,对于stringObj 中每个匹配 rgExp 中的位置都用该对象所包含的文字加以替换。在 Jscript 5.5 或更新版本中,replaceText 参数也可以是返回替换文本的函数。
      

  3.   

    http://www.javaeye.com/topic/30728
    我 收藏的
      

  4.   

    var       _madedate="2007-05-15";
    var       _madedate1=_madedate.replace(/-/g, "");
    alert(_madedate1) 
      

  5.   

    var _madedate1=_madedate.replace(/-/g, "");~汗楼主一个!大脑是需要转滴
      

  6.   

    还有没有天理啊!mingxuan3000 !每次都比我快几秒~那么多星星了还。。
      

  7.   

    少个参数var   _madedate1=_madedate.replace(/-/g,   "/"); /-/g是正则表达式,参数g是全局的意思 也就是匹配所有,而不是只匹配一次