I don’t get why it’s not working…
I have this index.jade file:
!!! 5
html
head
link(rel='stylesheet', href='/stylesheets/style.css')
script(src="/javascripts/jquery-1.8.2.js")
script
$("#rollButton").click(function() {
alert("sas");
});
body
input#rollButton(type="button", value="Roll")
It should pop up the alert! What am I missing?
Generated HTML seems OK:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="/stylesheets/style.css">
<script src="/javascripts/jquery-1.8.2.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script>
$("#rollButton").click(function() {
alert("sas");
});
</script>
</head>
<body>
<input id="rollButton" type="button" value="Roll">
</body>
</html>
I’m not familiar with [jade] yet, but shouldn’t there be jQuery “onReady” function, like this one:
EDIT: And I’m not sure about the indentation. It should be fixed too, as I see in other comments.