Guest User

Untitled

a guest
Jul 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. // Javascript
  2.  
  3. $('content').set('html','<ul id="item-list"><li></li></ul>');
  4.  
  5. alert(result.items.length); // always bigger than zero :)
  6.  
  7. $('item-list').render(result,{
  8. 'li':{'item<-items':{
  9. '.':'item.title'
  10. }
  11. }
  12. });
  13.  
  14. // in pure.js I've added simple alert in render function
  15.  
  16. function render(ctxt, directive){
  17.  
  18. alert(this.length);
  19.  
  20. var fn = typeof directive === 'function' && directive, i = 0, ii = this.length;
  21.  
  22. for(; i < ii; i++){
  23. this[i] = replaceWith( this[i], (fn || plugins.compile( directive, false, this[i] ))( ctxt, false ));
  24. }
  25.  
  26. context = null;
  27. return this;
  28. }
  29.  
  30. //and it alerts always undefined in Firefox & Safari
Add Comment
Please, Sign In to add comment