nested template

0 views
Skip to first unread message

tfreitas

unread,
Nov 10, 2009, 9:53:00 AM11/10/09
to PURE - JavaScript Templates Engine
Hi people


Below are two examples, the two examples work in Firefox and Chrome,
but in IE (6,7,8) does not work the second example

1) GOOD SAMPLE
<select class="make">
<option>Choose..</option>
<option class="values"></option>
</select>

2) BAD SAMPLE
<br/>
<div>
<div>
<p>
<span>
<label>Marca:</label>
<select class="make">
<option>Choose..</option>
<option class="values"></option>
</select>
</span>
</p>
</div>
</div>

PURE can work with a template as the second example?

Here is a problem
http://friendpaste.com/4eDERmKHgWUhHBDTyQ3GxZ

regards

tfreitas

unread,
Nov 10, 2009, 2:31:27 PM11/10/09
to PURE - JavaScript Templates Engine
Hi

I found 2 workaround

1) Change the nesting of the tag
<div>
<div>
<p>
<span>
<label>Marca:</label>
</span>
</p>
<select class="make">
<option>Choose..</option>
<option class="values"></option>
</select>
</div>


2) change internally PURE
instead of using innerHTML, use $ (). html jquery

http://brainof-dave.blogspot.com/2009/08/fusioncharts-ie6-and-unknown-runtime.html

the second solution does depend on jQuery

Mic Cvilic

unread,
Nov 11, 2009, 4:34:21 AM11/11/09
to pure-unobtrusive...@googlegroups.com
>
> 2) change internally PURE
> instead of using innerHTML, use $ (). html jquery
>
> http://brainof-dave.blogspot.com/2009/08/fusioncharts-ie6-and-unknown-runtime.html
>
> the second solution does depend on jQuery
>

Did you actually replaced the innerHTML operation by $().html() in
pure2.js, and it worked?
I'll check the jquery code, I think it uses documentFragment.
Cheers,
Mic

tfreitas

unread,
Nov 11, 2009, 9:11:18 AM11/11/09
to PURE - JavaScript Templates Engine
Yes, i replaced
pa.innerHTML = html => $(pa).html(html);

in the code:
---------------------------------------
var ep = elm.parentNode;
// avoid IE mem leak
ep.insertBefore(pa, elm);
ep.removeChild(elm);
//pa.innerHTML = html;
$(pa).html(html);
ne = pa.firstChild;
ep.insertBefore(ne, pa);
ep.removeChild(pa);
elm = ne;
------------------------------------

work perfect!

On Nov 12, 4:34 am, Mic Cvilic <tch...@gmail.com> wrote:
> > 2) change internally PURE
> > instead of using innerHTML, use $ (). html jquery
>
> >http://brainof-dave.blogspot.com/2009/08/fusioncharts-ie6-and-unknown...

tfreitas

unread,
Nov 21, 2009, 4:25:10 PM11/21/09
to PURE - JavaScript Templates Engine
any progress on this?
If I can help, tell me about it

On Nov 11, 5:34 am, Mic Cvilic <tch...@gmail.com> wrote:
> > 2) change internally PURE
> > instead of using innerHTML, use $ (). html jquery
>
> >http://brainof-dave.blogspot.com/2009/08/fusioncharts-ie6-and-unknown...

Mic (BeeBole)

unread,
Nov 22, 2009, 2:01:46 PM11/22/09
to PURE - JavaScript Templates Engine
Not yet. You can use your workaround while waiting for a cross browser
solution.

If you want to help, you can fork the repository (branch version2).
Modify the code using documentFragment to generate a dom node from the
html string instead of innerHTML.
I think it must be something in that direction.

Cheers,

Mic (BeeBole)

unread,
Nov 23, 2009, 10:30:00 AM11/23/09
to PURE - JavaScript Templates Engine
It was simpler than that, IE didn't like a div within a span.
I've changed it in the revision 2.22
Now it is span, IE is happy and the other browsers are ok in my test
suite and in our web app.
Please check your example.

tfreitas

unread,
Nov 26, 2009, 10:25:32 AM11/26/09
to PURE - JavaScript Templates Engine
Hi Mic

I check in my examples, and is OK

Thanks
Reply all
Reply to author
Forward
0 new messages