search

Home  >  Q&A  >  body text

node.js - Want to use node module querystring in .ejs file

Want to use the node module querystring

in the .ejs file

As the title says, how to use the querystring module in the contact.ejs file

Test Results

仅有的幸福仅有的幸福2752 days ago632

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 13:40:07

    console.log The reason why there is no response is because you are generating code and running it in HTML. JavaScript running in ejs must be wrapped.

    I don’t know if you want to run it in ejs or the generated HTML.

    If it is ejs:

    <% var querystring = require('querystring'); %>
    <%= querystring('...') %>

    If it is HTML, use it the same way you usually write JavaScript. Either put it on the server and import it through a link or package it into a bundle and import it.

    reply
    0
  • Cancelreply