E
E
Egor Trubnikov-Panov2014-09-24 19:35:54
JavaScript
Egor Trubnikov-Panov, 2014-09-24 19:35:54

How to dynamically add a new block to a page?

How to dynamically add a new block to a page?
In the project I use bem-bl.
I can't find in the documentation how to do it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artcl, 2014-09-24
@Artcl

BEMDOM.append("where", BEMHTML.apply({ block : 'bla' }));
or for example some domElem.append(BEMHTML.apply({ block : 'bla' }));
BEMDOM is an i-bem_dom dependency. BEMHTML, for example, can be accessed by including *.bemhtml.js. In your case, there may be a slightly different append, but the most important is BEMHTML.apply

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question