【问题标题】:Jade.js with jQuery带有 jQ​​uery 的 Jade.js
【发布时间】:2014-06-26 09:27:04
【问题描述】:

我目前有以下代码

doctype html
html
  head
    title Test
    link(rel='stylesheet', href='/stylesheets/style.css')
    link(rel='stylesheet', href='/stylesheets/bootstrap.min.css')
    script(src="/javascripts/jquery.js")

  body
    script.
      var start = Date.now()
      console.log(start)          
      div(id='microtime')
        p
    script.
      $(document).ready(function() {
      var end = (Date.now() - start) / 1000
      console.log(end)
      $('#microtime p').text = 'aa'
      })

我试图制作一个微时间来显示页面加载时间,目前代码在控制台上显示 0 个错误,但 #microtime p 文本没有更新,div 微时间没有任何 css 属性,并且 console.log 工作正常。 ..

【问题讨论】:

    标签: javascript jquery css node.js


    【解决方案1】:

    替换

    $('#microtime p').text = 'aa'
    

    $('#microtime p').text('aa');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-10
      • 2012-03-28
      • 2011-12-12
      • 2021-07-11
      • 2010-10-09
      • 2012-12-18
      相关资源
      最近更新 更多