我正在使用 Node.js、Express、Jade 和 Redis 开发一个应用程序,该应用程序将显示来自 reversebeacon.net 提供的 telnet 流中的点,这些点与业余无线电俱乐部成员的 Redis 数据库进行交叉引用,如果它们匹配则显示在我的应用程序的桌子上。到目前为止,所有这些都运行良好。
不幸的是,我必须刷新整个页面才能显示桌子上的新位置。我只想刷新包含表格的 div (#activeDiv),而不是设置刷新整个页面的间隔。
我在网上遇到的大多数示例都是针对 PHP 的,我尝试将这些示例用于我的应用程序,但到目前为止还不是很成功。
布局.jade
doctype 5
html
head
title HAMjitsu | Club Spotter (Flying Pigs, FISTS, SKCC, NAQCC)
link(rel='stylesheet', href='/stylesheets/style.css')
script(src='http://code.jquery.com/jquery-latest.js')
script
// nothing I've placed here has worked :-(
body
h1 HAMjitsu
p Welcome to HAMjitsu, the realtime tool that let's you see who's on the air right now!
p This application is in the early "alpha" phase of development. For now, the Flying Pigs will be able to see when their fellow piggies are causing havoc on the bands. But don't you worry, other clubs will soon be able to use this tool.
block content
索引.jade
extends layout
block content
div#activediv
table
thead
tr
th DE
th Freq
th DX
th NR
th Mode
th dB
th WPM
th CQ
th UTC
tbody
each spot, i in spots
tr
td: !{spot.de}
td: !{spot.freq}
td: !{spot.dx}
td: !{spot.nr}
td: !{spot.cw}
td: !{spot.snr}
td: !{spot.wpm}
td: !{spot.cq}
td: !{spot.utc}