【发布时间】:2012-07-30 11:45:33
【问题描述】:
我正在尝试在jade中做一个简单的警报事件,但它不工作,不知道是什么问题,也许你们能找到它?
代码: PS:你可以忽略socket.io代码
html
head
script(src='jquery-1.7.1.js')
script(src='/socket.io/socket.io.js')
script
var socket = io.connect('http://localhost:3002/add_users');
socket.on("update", function(message) {
console.log("update: ", message)
});
$(function() {
$("button").click(function() {
alert("hej");
});
});
body
.container
.content
header.page-header
h1 Welcome
.row
form(action='/', method='post')
fieldset
label(for="name") Namn
input(type="text", size="30", name="name", required="required")
button Save
ul
li <a href="/users">User list</a>
【问题讨论】:
-
你能把渲染的页面也贴出来吗?
标签: javascript jquery web click pug