Message from JavaScript discussions

October 2017

— Yes. That should would but I think you need to put a “/“ in front of your subexamples


You can use Route objects, something like this:
var router = express.Router();
router.get('/', function (req, res, next) {

— Since Router implements Middleware interface you can use it like one.

— Halp

— How to get data-pk value using js from this element?

<button type="button" class="btn btn-danger btn-xs editor_remove" data-pk="1">Delete</button>

Message permanent page

— button.getAttribute('data-pk')

— Button is not defined

— 😕

— Oh wait

— Give an id to the button and use document.getElementById


my_table.on('click', 'button.editor_remove', function (e) {
document.getElementById('delete_pk').value = e.element.getAttribute('data-pk');

Message permanent page

— I wanna set document.getElementById('delete_pk').value to data-pk value