M
M
mrSand2014-10-02 16:30:07
Node.js
mrSand, 2014-10-02 16:30:07

Jade template, how to pass data to script tag?

We have a jade page template to which the data array data.Asisstants is passed beautifully (res.render)

extends layout
block content
   - var Asisstants = data.Asisstants
   - var len1 = Asisstants.length
   // так данные передаются
   p= 'len1: ' + len1
   script.
         // так не работает(
         var TS = data.Asisstants; 
         // 
         var len2 = TS.length;
         document.writeln('len2:  ' + len2);

How can I pass data inside the script tag?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question