Lurker News

Comments (337) 70 threads

Show all comments

Showing thread 26 of 70

randlet1 reply#
Works very well for me.

dieulot, is there a small bug with the allowQueryString check?

    const allowQueryString = 'instantAllowQueryString' in document.body.dataset
I think should be:

    const allowQueryString = 'instantallowquerystring' in document.body.dataset

If I have:


then

    'instantAllowQueryString' in document.body.dataset === false
and

    'instantallowquerystring' in document.body.dataset === true
because html data attributes get converted to lowercase by the browser (I think).
dieulot1 reply#
Uppercase is converted to added dashes. `document.body.dataset.instantAllowQueryString` corresponds to `data-instant-allow-query-string`.
randlet#
Cool thanks! Didn't know that.