Hi,
> Steve, on the other hand, even if you use the standard methods to create
> elements, you will not get content and structure separated of course.
Yes of course. If that is the goal, use load() to get some template-content or
clone it from the page and fill it with your dynamic data:
$('#show-alert').click(function() {
var clone = $('.alerttemplate')
.clone()
clone.html(
clone.html()
.replace(/\$\{content\}/,"Alert! Watch me before it's
too late!")
.replace(/\$\{class\}/,'quick-alert')
).insertAfter(this);
});
Of course that is longer, but it should be the best way to really separate
content and code. Oops we have been using innerHTML ;-)
Of course for some browsers that can be resolved with XSL/T, but, alas we need
ActiveX to convince IE to cooperate...
Yes, I try to avoid innterHTML wherever possible, but I don't think there
should be a dogma.
Christof
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/