javascript - Adding to html elements from jade script -


i new jade , trying make website context changing regarding data on server. since need add unknown amount of div figured should this:

html   head     title match support   body     script(type='text/javascript' src='http://code.jquery.com/jquery.min.js')      h1 same     h3 games:       #container      script.         //var matches = json.parse(!{match});         var matches = !{matchlist};          (var = 0; < matches.length; i++){             // how add #container here?          } 

i have tried jquery couldn't make work.

any appreciated!

if data asynchronously server, not question jade, jquery add elements dom, example

    matchlist.foreach(function(match) {         var = "<a class='ui label'>" + match.property + "</a>";         $('#container').append(a);     } 

if render *.jade page passing data there can use for-loop in jade

.ui.segment#container each match in matchlist   a.ui.label     | #{match.property} 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -