Reputation: 165
A night of fun.
The standard template of
#{media[i+2]._id}
Works most of the time... but being able to pass this spaghetti code into jQuery functions is becoming impossible for me.
Here's the options I've tried:
input.btn.btn-success(onclick='UpdateStatus(#{media[i+2]._id})', type='button', value='Approve')
Will not work. Will give me an illegal token error.
However if I inspect the element it's what I wanted.......
<a href="#" onclick="UpdateStatus(5224207bc90df58486947d70)" class="btn btn-success">Approve</a>
Really stuck guys, thanks for the help!
Rob.
Upvotes: 0
Views: 1251
Reputation: 14953
I think what you really want is:
onclick="UpdateStatus("5224207bc90df58486947d70")"
Note the added quotes, since it's not a number but a hex string. Thus:
input.btn.btn-success(onclick='UpdateStatus("#{media[i+2]._id}")', type='button', value='Approve')
Upvotes: 0