Skip to content

How to pass a value from Node.js server to an embedded Javascript code inside HTML page?  #3416

Description

@Mqzzaz

Hi guys. I'm working on this project in which i need to pass a data brought from Mysql database via Node js server to HTML page that has embedded Javascript code to use this data to draw a chart by using Chart.js library.
This is the node.js code:
Image with credentials removed. // @ChALkeR
and here the HTML page(index.ejs) where i want to use the "title" array values inside the script to fill the "data" array for the chart
Chicago commercial photographers
So, if i tried to use the "title" directly , nothing would show up in the page(blank page).
Any solution?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions