Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd to html pages in my project custom atribute that will be called by it self (like as data-bind)
    primarykey
    data
    text
    <p>I want to create custom attribute in my project, that will be called in the same moment that the "data-bind" attribute is calles. I want you to understand me well, so please read my explaining: I know how do create custom attribute and know how to use it. but the problem is, that my project has very many pages. I don't want that all team-member how will want to use my attribute (called "data-re"), to call my function. I want that as same as the "data-bind" attribute is solved any-way, and you didn't have to call it each page, so I want to find place to write my code, that this code will be done every page without needing to write it specifily. here is my code:</p> <pre><code> &lt;input type="text" data-re="value:40"/&gt; function compositionComplete(){ var dict = cacheManager.get(cacheItems.DICT);; var reElms = document.querySelectorAll('[data-re]'); for (var n = 0; n &lt; resElms.length; n++) { var reEl = reElms[n]; if (n != 1) { var dataRe = reEl.getAttribute('data-re'); while (dataRe) { var attr = dataRe; var cutPlace = dataRe.lastIndexOf(','); if (cutPlace &gt;= 0) { attr = reKey.substring(cutPlace, dataRe.length - 1); } var reKey = attr.substring(attr.indexOf(':') + 1, attr.length); var attrName = attr.substring(0, attr.indexOf(':')); reEl[attrName] = dict[reKey].Descript; dataRe = dataRe.substring(attr.length, dataRe.length); if (cutPlace) dataRe = dataRe.substring(0, 1); } } } </code></pre> <p>my project is in durandal. till now the code behind the "data-re" attribute is in the "compositionComplete". I don't want to need to write anything about it in my pages! what should I do? thank you, Rut Nativ.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload