I have been using page.js for nodejs applications in different projects, however, my newest one is exploring a massive download data from a postgresql database, which affects how elements are been rendered.
What is the best approach to make anchor tags works?, for example:
const page = require('page')
const d3 = require('d3')
page('/view', (ctx, next) => {
let qs = ctx.querystring
let a = d3.select('#get-back')
a.attr('href', `/?${qs}`)
next()
}
After I click the anchor tag in view, I get Uncaught TypeError: Cannot set property 'href' of null. If element is not available, how can I use page.js to make the link works and return to home view where data was downloaded?
I tried a setTimeout function, but I do not know if this is the best approach.
I have been using page.js for nodejs applications in different projects, however, my newest one is exploring a massive download data from a postgresql database, which affects how elements are been rendered.
What is the best approach to make anchor tags works?, for example:
After I click the anchor tag in view, I get
Uncaught TypeError: Cannot set property 'href' of null
. If element is not available, how can I usepage.js
to make the link works and return to home view where data was downloaded?I tried a
setTimeout function
, but I do not know if this is the best approach.