有个问题<button id="aaa" name="refresh" value="refresh" ></button> 这样按钮里怎么不显示refresh字样?
第二个问题 $('button[name=refresh]').click(function(){
$('#captchaImg')[0].src = '/my/salary/captcha/?' + getdate('Y-m-d H:i:s');
});这里我想加getdate('Y-m-d H:i:s'); 这个来获取每次的时间,但貌似这么写不对。

解决方案 »

  1.   

    1、<button id="aaa" name="refresh" >refresh</button> 
      

  2.   

    第一个问题改成:<input type="button" id="aaa" name="refresh" value="refresh" />第二个问题
    $('button[name=refresh]').click(function(){
    $('#captchaImg')[0].src = '/my/salary/captcha/?' + new Date().getdate('Y-m-d H:i:s');
    });
      

  3.   

    <button id="aaa" name="refresh">refresh</button> HTML <button> 标签
    定义和用法
    <button> 标签定义一个按钮。在 button 元素内部,您可以放置内容,比如文本或图像。这是该元素与使用 input 元素创建的按钮之间的不同之处。<button> 控件 与 <input type="button"> 相比,提供了更为强大的功能和更丰富的内容。<button> 与 </button> 标签之间的所有内容都是按钮的内容,其中包括任何可接受的正文内容,比如文本或多媒体内容。例如,我们可以在按钮中包括一个图像和相关的文本,用它们在按钮中创建一个吸引人的标记图像。唯一禁止使用的元素是图像映射,因为它对鼠标和键盘敏感的动作会干扰表单按钮的行为。时间相关操作
      

  4.   

    $('#captchaImg')[0].src = '/my/salary/captcha/?' + new Date().getdate('Y-m-d H:i:s');
    这样写了之后在firebug上调试的时候提示如下TypeError: (new Date).getdate is not a function
      

  5.   

    The getDate() method returns the day of the month (from 1 to 31) for the specified date, according to local time. The getTime() method returns the number of milliseconds since midnight of January 1, 1970 and the specified date.
      

  6.   

    http://www.w3schools.com/jsref/jsref_obj_date.asp
      

  7.   

    $('button[name=refresh]').click(function(){
    $('#captchaImg')[0].src = '/my/salary/captcha/?' + new Date().getdate('Y-m-d H:i:s');
    });这个后面参数不能获取具体时间(精确到秒,我是想用这个不同的时间(秒)来刷新图片,后面参数(时间)不一样才能够刷新图片)
      

  8.   

    $('button[name=refresh]').click(function(){
    $('#captchaImg')[0].src = '/my/salary/captcha/?' + new Date().getTime();//getTime()返回距1970年的毫秒数。
    });