Instead of doing:
var html = '<a href="' + data.href + '" title="' + data.title + '">' + data.desc + '</a>';
I'm doing:
var html = '<a href="{href}" title="{title}">{desc}</a>';
html = html
.replace( '{href}', data.href )
.replace( '{title}', data.title )
.replace( '{desc}', data.desc );
Or replace( /{nome}/g, data.nome )
if there are multiple occurrences.
Is there any "official" way or does each have to resolve on your own by creating a custom function?
I found a couple of legacy plugins for jQuery, 2007 and 2008 . Has anything changed from there to here? Do JavaScript frameworks, such as jQuery or Mootools, already incorporate this? If so, what is the JS behind it?